Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: JAVA SWING - Print

  1. #1
    Junior Member
    Join Date
    Oct 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default JAVA SWING - Print

    Hi


    I want to print a JFrame or JPanel.

    I have 5 components in my Frame but only One Component is getting Print.

    Please tell me solution with proper example.


    Regards,

    Sadhana Mulik


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    4,453
    My Mood
    Mellow
    Thanks
    146
    Thanked 607 Times in 594 Posts

    Default Re: JAVA SWING - Print

    PROBABLY (just a guess) because all components are being added to the center of the JFrame, on top of each other. If you'd have mentioned that only the last item added was shown, I'd be even more sure.

    The default layout for JFrame is BorderLayout, and components are added to CENTER by default. Use another layout for your JFrame or add the components to different area of the existing BorderLayout.

Similar Threads

  1. print a form in java netbeans
    By seemarani in forum What's Wrong With My Code?
    Replies: 5
    Last Post: May 2nd, 2013, 08:45 AM
  2. Replies: 1
    Last Post: December 3rd, 2012, 01:35 PM
  3. Java program to Add a JMenu toolbar to a Java Swing application
    By JavaPF in forum Java Swing Tutorials
    Replies: 6
    Last Post: March 6th, 2012, 11:25 AM
  4. HELP! HOW TO PRINT A GRID IN JAVA (NO GUI...)
    By imicrothinking in forum Java Theory & Questions
    Replies: 0
    Last Post: October 19th, 2011, 08:39 AM
  5. Replies: 2
    Last Post: July 23rd, 2011, 03:29 PM