Results 1 to 7 of 7
- 08-15-2008, 08:44 PM #1
Member
- Join Date
- Aug 2008
- Posts
- 20
- Rep Power
- 0
My first post, how to open 2nd window?
Hello forum,
I hope this is the right place to ask this, otherwise, well, sorry admin...
My first post here!
NetBeans on ubuntu
Fresh in Java, I have little experiance with C#.
How do I open a new window (form2) from main form?
A code example would be greatest (where to paste it...)
Kind regards, Grom
- 08-15-2008, 09:11 PM #2
Use the same code you used to create the first window to create the second one. Change the names to make them unique.
Write a small program that creates a window. Then add to that program the code to create another one.
Come back when you have problems.
There are many examples of code on how to create a window. Search for JFrame
- 08-16-2008, 03:54 AM #3
Member
- Join Date
- Feb 2008
- Location
- South Jordan, Utah, USA
- Posts
- 5
- Rep Power
- 0
Hello Grom,
If you are working on a Web-App, try the Visual JSP features of NetBeans. Also check out netbeans.org/kb/index.html - for the NetBeans tutorials .. an excellent place for beginners to start!
- 08-16-2008, 05:33 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
How do you want to open the second form on the first one? As a separate window(may be on an event) or as an internal one?
- 08-16-2008, 07:48 PM #5
Member
- Join Date
- Aug 2008
- Posts
- 20
- Rep Power
- 0
Hello and thank you for your replays!
Ok, I forgot to mention that I am making Desktop application.
jFrame got me started.
I have three calculators. Each one are opened in a new window from main window. In other words I have one main window, and from it
- I can open three different calculators (as many as I like),
- calculate and
- close 'calculator' window..
Saved calculations are being displayed in main window.
I got this far; On main window I have a trigger that runs these lines:
Form2 f2 = new Form2();
f2.show();
this opens new 'calculator window'.
The problem is, as I try to close ANY of calculators windows, it is all being closed, even the main window.
How can I avoid this?
Kind regards, Grom
- 08-16-2008, 08:28 PM #6
You don't show your code so this is only a quess.
Check how you are handling the closing of JFrames. One of the options will exit the JVM. Some of them will only dispose of the window, some will ignore the close.
Read the API doc for JFrame and look at the methods beginning with set....
- 08-17-2008, 03:00 AM #7
Member
- Join Date
- Aug 2008
- Posts
- 20
- Rep Power
- 0
Similar Threads
-
First post ever
By pbpersson in forum IntroductionsReplies: 4Last Post: 08-16-2008, 05:30 AM -
First post as per request
By happyknappy in forum IntroductionsReplies: 3Last Post: 07-30-2008, 01:33 AM -
How to close an open JFrame window from a jsp page?
By kasisaiganesh in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 05-27-2008, 06:29 PM -
Drive letter sniff/open explorer window
By iiz in forum New To JavaReplies: 1Last Post: 04-04-2008, 03:50 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks