« Return to Thread: Couple of newb questions...
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?
« Return to Thread: Couple of newb questions...
| Free embeddable forum powered by Nabble | Forum Help |