Solved

JFrames

Posted on 2002-04-12
7
325 Views
Last Modified: 2013-11-23
is it possible to add a JFrame to a Jframe?
0
Comment
Question by:Codster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
The viewer will learn how to implement Singleton Design Pattern in Java.

728 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