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
Solved

JFrames

Posted on 2002-04-12
7
321 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

860 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