Couple of newb questions...

View: New views
3 Messages — Rating Filter:   Alert me  

Couple of newb questions...

by ToeScrum :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi All,



I'm using NetBeans for the first time (be gentle :) ) and I have a few questions about stuff that I have no experience with...



I currently have a screen class that shows a frame, some panels and buttons, and a driver class that calls the screen class in main with this (auto-generated) code:




Code:
java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {

                new solarScreen().setVisible(true);

            }

        });



where solarScreen is the screen I mentioned.



1. How can I pass an object, declared in main, to solarScreen?

I tried this (after modifying solarScreen's constructor):


Code:
B b = new B();

java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {

                new solarScreen( b ).setVisible(true);

            }

        });



but it wouldn't compile, it insisted I make b Final, which I don't want to do.





2. How can I stop/remove/make invisible(?) solarScreen, and replace it with another screen?

ie. I'm viewing screen X, I click a button and am now viewing screen Y.  I can also then click a button here to go back to screen X.

I'd prefer to completely get rid of one screen before showing the next, rather than just hiding one while showing the other.





3.  My screen is 320x240 pixels, can I make it so I can click maximise to go to full screen, and have all things in the screen scaled up to to the new size?  I assume this is so common that I can do it in the Frame's properties or somewhere like that?





Re: Couple of newb questions...

by John Yeary :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Please send your request to the correct forum. This is a Java Enterprise Edition forum and that is a general question.

nbusers@...


On Thu, Jul 9, 2009 at 9:13 AM, ToeScrum <ferg200@...> wrote:
Hi All,



I'm using NetBeans for the first time (be gentle :) ) and I have a few questions about stuff that I have no experience with...



I currently have a screen class that shows a frame, some panels and buttons, and a driver class that calls the screen class in main with this (auto-generated) code:




Code:
java.awt.EventQueue.invokeLater(new Runnable() {

           public void run() {

               new solarScreen().setVisible(true);

           }

       });



where solarScreen is the screen I mentioned.



1. How can I pass an object, declared in main, to solarScreen?

I tried this (after modifying solarScreen's constructor):


Code:
B b = new B();

java.awt.EventQueue.invokeLater(new Runnable() {

           public void run() {

               new solarScreen( b ).setVisible(true);

           }

       });



but it wouldn't compile, it insisted I make b Final, which I don't want to do.





2. How can I stop/remove/make invisible(?) solarScreen, and replace it with another screen?

ie. I'm viewing screen X, I click a button and am now viewing screen Y.  I can also then click a button here to go back to screen X.

I'd prefer to completely get rid of one screen before showing the next, rather than just hiding one while showing the other.





3.  My screen is 320x240 pixels, can I make it so I can click maximise to go to full screen, and have all things in the screen scaled up to to the new size?  I assume this is so common that I can do it in the Frame's properties or somewhere like that?







--
John Yeary
--
http://javaevangelist.blogspot.com

"Far better it is to dare mighty things, to win glorious triumphs, even though checkered by failure, than to take rank with those poor spirits who neither enjoy much nor suffer much, because they live in the grey twilight that knows not victory nor defeat."
-- Theodore Roosevelt

Couple of newb questions...

by ToeScrum :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, sorry about that, I didn't realise it was in the wrong section.



I don't know if I can move a thread ??



I'm just going to copy it across...