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 4 of 4

Thread: jFrame print

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

    Default jFrame print

    Hello guys.
    I,m a total noob on java (first of all).
    But i managed to set up a CRUD form in java with netbeans and mysql.
    Now I'm stuck on trying to hard print the content (A4) of a jFrame that include all the infos that i need.
    If some of you guys are willing to help i really appreciate it.

    Best
    raz
    Last edited by raz77; October 10th, 2017 at 10:14 AM.

  2. #2
    Member
    Join Date
    Apr 2014
    Posts
    81
    Thanks
    3
    Thanked 6 Times in 6 Posts

    Default Re: jFrame print

    Hi,

    I'm not sure what you mean by "hard print". Do you mean sending a print job to a printer?

    Also, it's not clear what you mean by "the content (A4) of a jFrame". Do you mean a specific field in the database table?

  3. #3
    Junior Member
    Join Date
    Oct 2017
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: jFrame print

    Hello Binary and sorry for delay.
    Yes i want to print the content of a specific jframe that contains (text fields,image,and other type of info) with a printer.
    and i want that the content of the jframe to fit in an A4 page.

    Thanks again for your response.

    Best
    Raz

  4. #4
    Member
    Join Date
    Apr 2014
    Posts
    81
    Thanks
    3
    Thanked 6 Times in 6 Posts

    Default Re: jFrame print

    Sounds like a job for Java's Printing APIs:

    https://docs.oracle.com/javase/tutor...ing/index.html

    The "Printing the Contents of a User Interface" section has an example of how to print a JFrame and all its child components exactly as they appear on the screen. If you need any other fine-tuning, you can print pretty much anything that can be drawn with Graphics2D including images, gradients, rotations, etc.

Similar Threads

  1. How to Print JFrame content using NetBeans Java Swing
    By vk020 in forum AWT / Java Swing
    Replies: 3
    Last Post: September 12th, 2014, 04:25 AM
  2. How to print JFrame content
    By vk020 in forum What's Wrong With My Code?
    Replies: 0
    Last Post: September 12th, 2014, 04:15 AM
  3. Replies: 1
    Last Post: December 3rd, 2012, 01:35 PM
  4. problem with my JFrame; JFrame not closing and stay in background
    By golominator in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 6th, 2012, 07:20 AM
  5. Print out a JFrame
    By ellias2007 in forum AWT / Java Swing
    Replies: 8
    Last Post: June 17th, 2010, 06:15 AM