Solved

JFrames

Posted on 2002-04-12
7
320 Views
Last Modified: 2013-11-23
is it possible to add a JFrame to a Jframe?
0
Comment
Question by:Codster
  • 4
  • 3
7 Comments
 
LVL 92

Expert Comment

by:objects
ID: 6937941
I don't believe so.
Have a look at JInternalFrame it may do what you're after.
0
 

Author Comment

by:Codster
ID: 6937952
What i really want to do is print the contents of a Jpanel using something similar to

public void printPage(JFrame jf, String title)
{
     Properties pProp = new Properties();
     PrintJob pJob = Toolkit.getDefaultToolkit().getPrintJob(jf,title,pProp);

......
}

where jf is a JPanel ????
any suggestions ????
0
 
LVL 92

Accepted Solution

by:
objects earned 10 total points
ID: 6937960
What's that got to do with frames in frames :-)

Have a look at Sun's Java tutorial on printing it should so you what to do.
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:Codster
ID: 6938069
i was going to try and change my JPanel to a JFrame and then print that instead of the panel but it wasnt really ever going to work out.

the printing method works fine, it brings up the printing dialog box and prints a sheet but theres nothing there to print!!!!

Thanks for all your help
your great!

the whole project is due in on monday afternoon anyway so im only trying to get more marks by putting in the printing function!

Thanks again
0
 
LVL 92

Expert Comment

by:objects
ID: 6938103
> i was going to try and change my JPanel to a JFrame

Don't think this will make any difference

> but theres nothing there to print!!!!

Do you call the JPanel's print() method?


Sorry I can't be more help, I've got a few deliverables to complete for some clients.
0
 

Author Comment

by:Codster
ID: 6938116
Thank you for the suggestion
ill have a look
actually just a small other question since your busy - can you load the contents of a JPanel into a Graphics object and maybe print the graphics object?


(I'll be using java for 6 months soon so this is why i know nothing!!!!!!)

Thank you
0
 
LVL 92

Expert Comment

by:objects
ID: 6938124
> can you load the contents of a JPanel into a Graphics object ...

That's what the print() method is for.

http://www.objects.com.au
Brainbench MVP for Java 1
http://www.brainbench.com
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
print map entry 34 69
Apps blocked by Java 9 81
Can anyone please tell me why i can not find ID  investorCoolGrid inside the jsp page? 1 20
jboss wildfly 10.1 10 97
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question