Java built by Netbeans

Ryan O'Neill

Ranch Hand

Posts: 86

posted 2 years ago

I would like a small box to be able to enter a contacts information and I started with building it thru netbeans. Now I am thinking I should start from scratch so I understand everything. What should I do? I am having trouble making the buttons at the bottom work. All I would like to be able to do is but I can't seem to be able to do that without loosing the whole project not just the frame I am working on.

*Edit* The buttons I am referencing are the Cancel & Accept

Campbell Ritchie

Sheriff

Posts: 55371

157

posted 2 years ago

I shall move you to out GUIs forum.

It is probably a good idea never to extend display classes (except overriding JPanel#paintComponent), so I would suggest you change it so the frame is a field or even a local variable in the initComponents method. You would have to change all your add(...) calls to frame.add(...)
You will have to work out your own layouts. Start with the Java® Tutorials.

If you make the frame visible or invisible, it will appear and disappear. And everything else will go with it because a frame is a top-level container. When the frame disappears everything else disappears.