Avatar of Sarki Amada
Sarki Amada
Flag for United States of America asked on

Add Printing Settings in Java Code

Hello!

I'm new to java, I have a jTextArea that I want to send it's content to print.
I was able to achieve that using
Boolean complete=jValueText.print();
            if (complete){
                JOptionPane.showMessageDialog(null, "Done Printing...");
            }
            else{
                JOptionPane.showMessageDialog(null, "Printing...");
                
            }

Open in new window


This approach will show a printer dialog and the user can set the settings, like paper orientation etc. But I'll like to just set the settings in the java code, so when the user clicks the print button, it will just print the text using the settings I configured in the java code.
The settings I want to configure are;
Page size
Orientation
Printer to use
Scale size of the page
I'm using Netbeans 8.2, MacBook Pro Sierra
Java* jtextPrinters and Scanners

Avatar of undefined
Last Comment
hdhondt

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
CEHJ

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
hdhondt

No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Accept: CEHJ (https:#a42348335)

If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

hdhondt
Experts-Exchange Cleanup Volunteer
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes