Hi,
I learnt that Java had AWT in the first place, then Swing was developed. When I took a look at Java book by Herbert Schildt, he says that we should know AWT to learn Swing better. Is this really that necessary?
Second, I have some codes. I was just trying to form a window. Not filling it or making my app usable. Here is the code:
This is the class I build my window.
import java.awt.*; public class myWindow extends Frame{ Frame pencere = new Frame(); public void myMethod(Frame f){ f = pencere; f.setSize(500, 600); f.setVisible(true); } }
This is the main class which should 'initialize' my window. At least I guess so
import java.awt.*; public class myFirstClass extends Frame{ public static void main(String[] args) { myWindow pencerem = new myWindow(); pencerem.myWindow(new Frame("Did it work?")); } }
I know it has problems like it won't close I should have added something to make the window disappear. But this was just an experiment.
For now, what I want to know is that:
With this code [pencerem.myWindow(new Frame("Did it work?"));], I set my window(frame) and it shows up. But I don't know what my window should be called in the main method. How do I know that? Or how could I put this in a better way?
Thanks in advance, for all your comments and helps. They are much appreciated.