Results 1 to 8 of 8
- 06-01-2010, 06:23 PM #1
Member
- Join Date
- May 2010
- Posts
- 9
- Rep Power
- 0
- 06-01-2010, 06:52 PM #2
Where is the class JForm defined? I don't see it in the JDK API doc.
- 06-01-2010, 06:56 PM #3
Member
- Join Date
- May 2010
- Posts
- 9
- Rep Power
- 0
JFrame frame = new JFrame();
JLabel lblimage = new JLabel(new ImageIcon(image));
lblimage.setVisible(true);
//
JPanel mainPanel = new JPanel(new BorderLayout());
mainPanel.add(lblimage);
// // add more components here
frame.add(mainPanel);
//
frame.setSize(300, 500);
frame.setVisible(true);
so this image is in my one form. i want to show it in another form. i mean the whole form should display in top of the other form.
is it possible. can you please guide me
- 06-01-2010, 07:12 PM #4
What do you mean by "form"?
There are windows that display on a computer's screen and there are JFrame classes that are used in programs that want to display a window.
- 06-01-2010, 07:16 PM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
-
Best advice: read the Sun Swing tutorials as these will be your best guide for creating Swing applications. You can find them here: Lesson: Using Swing Components (The Java™ Tutorials > Creating a GUI With JFC/Swing)
Luck!
- 06-01-2010, 09:18 PM #7
Um, JFrame (and JDialog) do not inherit from JComponent, which is the ancestor of all light weight components. Top level windows are (almost by definition) heavy weight.
The rule is that you cannot add a Window to a Container. The code behind that is found in Component.java line 430 - 432Java Code:if (comp instanceof Window) { throw new IllegalArgumentException("adding a window to a container"); }
- 06-01-2010, 09:21 PM #8
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
Similar Threads
-
looking for a form pane or form group panel for the jpanel to complete tutorial
By nadeemshafi9 in forum AWT / SwingReplies: 1Last Post: 03-22-2010, 10:03 AM -
use Servlet submit the form to receive a form for the Chinese but it shows the garble
By dmt198704 in forum Java ServletReplies: 0Last Post: 10-31-2009, 10:24 AM -
want to generate a html form page with dynamic data and submit this form to a url
By vishalkrsrivastava in forum Java AppletsReplies: 10Last Post: 08-12-2009, 05:02 PM -
[SOLVED] How to close the current form when i open a new form?
By tpyq in forum NetBeansReplies: 6Last Post: 11-28-2008, 07:55 AM -
Jtree link to JFrame Form
By daniel50096230 in forum NetBeansReplies: 4Last Post: 09-16-2008, 07:53 AM
Bookmarks