Solved

JFrames

Posted on 2002-04-12
7
324 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

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

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
check java version using powershell 13 443
Android development question 2 108
Where are the c++ header files to use in Eclipse? 4 73
How to fix  socket closed error 11 60
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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
Suggested Courses

739 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