new class from jframe [message #54427] |
Wed, 04 August 2004 08:26  |
Eclipse User |
|
|
|
Originally posted by: khw.warnkoenig.de
Hi all,
if I create a new class with the visual editor there are some thing
mysterious.
1. Is it correct that ther is NO setVisible somewhere?
2. There is no MyFrametype myFrame = new MyFrametype() in the main method?
3. where must I put the JMenuBar on. On the frame (= this) or on the
jContendPane?
Thanks for help
Karl-Heinz
--
________________________
Warnk
|
|
|
Re: new class from jframe [message #54480 is a reply to message #54427] |
Wed, 04 August 2004 10:08  |
Eclipse User |
|
|
|
Originally posted by: myersj.nospam.us.ibm.com
Karl-Heinz,
To answer your questions:
1 - Yes, it is correct that there is no setVisible automatically
generated for you. This frame could be another frame in an application
rather than the initial, main frame. Feel free to set the visible
property to true on the property sheet.
2 - Yes, we don't put any code into the main method while working with
Swing or AWT. It's up to the user to decide how they want their
application to start. In SWT we auto-generate the event loop for you in
the main method if you chose to create a main method in the new Visual
Class wizard.
3 - In most cases, you should put the JMenuBar onto the JFrame.
JMenuBar is simply another Swing component, so it can be placed anywhere
a normal component could be, including within the content pane.
Hope this helps,
- Jeff
K-H Warnkönig wrote:
> Hi all,
>
> if I create a new class with the visual editor there are some thing
> mysterious.
>
> 1. Is it correct that ther is NO setVisible somewhere?
> 2. There is no MyFrametype myFrame = new MyFrametype() in the main method?
> 3. where must I put the JMenuBar on. On the frame (= this) or on the
> jContendPane?
>
> Thanks for help
>
> Karl-Heinz
>
> --
> ________________________
> Warnkönig Elektronik
>
> Karl-Heinz Warnkönig
> Im Weinberg 3
> 88709 Meersburg
>
> tel. 07532 5432
> fax. 07532 2484
>
>
|
|
|
Re: new class from jframe [message #596716 is a reply to message #54427] |
Wed, 04 August 2004 10:08  |
Eclipse User |
|
|
|
Karl-Heinz,
To answer your questions:
1 - Yes, it is correct that there is no setVisible automatically
generated for you. This frame could be another frame in an application
rather than the initial, main frame. Feel free to set the visible
property to true on the property sheet.
2 - Yes, we don't put any code into the main method while working with
Swing or AWT. It's up to the user to decide how they want their
application to start. In SWT we auto-generate the event loop for you in
the main method if you chose to create a main method in the new Visual
Class wizard.
3 - In most cases, you should put the JMenuBar onto the JFrame.
JMenuBar is simply another Swing component, so it can be placed anywhere
a normal component could be, including within the content pane.
Hope this helps,
- Jeff
K-H Warnkönig wrote:
> Hi all,
>
> if I create a new class with the visual editor there are some thing
> mysterious.
>
> 1. Is it correct that ther is NO setVisible somewhere?
> 2. There is no MyFrametype myFrame = new MyFrametype() in the main method?
> 3. where must I put the JMenuBar on. On the frame (= this) or on the
> jContendPane?
>
> Thanks for help
>
> Karl-Heinz
>
> --
> ________________________
> Warnkönig Elektronik
>
> Karl-Heinz Warnkönig
> Im Weinberg 3
> 88709 Meersburg
>
> tel. 07532 5432
> fax. 07532 2484
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04484 seconds