Results 21 to 23 of 23
- 09-06-2009, 04:59 AM #21
Member
- Join Date
- Aug 2009
- Posts
- 50
- Rep Power
- 0
First I would like to say I think NetBeans led me down the wrong path with the code in their skeleton Template for GUI apps that says:
If you use that method like I do here:Java Code:/** * A convenient static getter for the application instance. * @return the instance of GuiPiecesApp */ public static BiditApp getApplication() { return Application.getInstance(BiditApp.class); }
The program will not terminate correctly. However, NetBeans uses it in the aboutBox method and it closes correctly. So I investigated what was happening in the aboutbox class and found the word SUPER. I decided to see if that could be used in my program and if it would fix the error. So I did this:Java Code:private javax.swing.JRadioButton sort6button; private javax.swing.JList sort7Contain; private javax.swing.JRadioButton sort7button; private javax.swing.JLabel statusAnimationLabel; private javax.swing.JLabel statusMessageLabel; private javax.swing.JPanel statusPanel; private javax.swing.JList trashContain; private javax.swing.JRadioButton trashbutton; // End of variables declaration private DefaultListModel bidLinesdlm = new DefaultListModel(); //added per Tim Huey and Netbeans.org private DefaultListModel sort1Listdlm = new DefaultListModel(); private DefaultListModel sort2Listdlm = new DefaultListModel(); private DefaultListModel sort3Listdlm = new DefaultListModel(); private DefaultListModel sort4Listdlm = new DefaultListModel(); private DefaultListModel sort5Listdlm = new DefaultListModel(); private DefaultListModel sort6Listdlm = new DefaultListModel(); private DefaultListModel sort7Listdlm = new DefaultListModel(); private DefaultListModel trashListdlm = new DefaultListModel(); private DefaultListModel bidListdlm = new DefaultListModel(); private ListTransferHandler lh; private DefaultListModel lm = new DefaultListModel(); //added per Tim Huey and Netbeans.org private final Timer messageTimer; private final Timer busyIconTimer; private final Icon idleIcon; private final Icon[] busyIcons = new Icon[15]; private int busyIconIndex = 0; private LineObject line; private ArrayList lines = new ArrayList(), sequences=new ArrayList(); private Vector panelist = new Vector(); private Hashtable seqHashTable = new Hashtable(); private Hashtable lineHashTable = new Hashtable(); private String[] seqText = new String[6]; [B][COLOR="Red"]JFrame mainFrame = BiditApp.getApplication().getMainFrame();[/COLOR][/B]
and VOILA it works. And whats more, the whole program works as before and it now shuts down correctly. You may throw praises at me now or flowers or money!!! I probably wasn't using the method of getting the frame correctly in the first place but the directions sure appeared to indicate I could do it that way. Oh well, hope it helps anyone who might be having the same problem. I learned to program using punchcards on a IBM 360 mainframe. OOP is kicking my butt. When I went to college C was a neat idea that MIGHT catch on someday but wasn't a required course.Java Code:private javax.swing.JRadioButton sort6button; private javax.swing.JList sort7Contain; private javax.swing.JRadioButton sort7button; private javax.swing.JLabel statusAnimationLabel; private javax.swing.JLabel statusMessageLabel; private javax.swing.JPanel statusPanel; private javax.swing.JList trashContain; private javax.swing.JRadioButton trashbutton; // End of variables declaration private DefaultListModel bidLinesdlm = new DefaultListModel(); //added per Tim Huey and Netbeans.org private DefaultListModel sort1Listdlm = new DefaultListModel(); private DefaultListModel sort2Listdlm = new DefaultListModel(); private DefaultListModel sort3Listdlm = new DefaultListModel(); private DefaultListModel sort4Listdlm = new DefaultListModel(); private DefaultListModel sort5Listdlm = new DefaultListModel(); private DefaultListModel sort6Listdlm = new DefaultListModel(); private DefaultListModel sort7Listdlm = new DefaultListModel(); private DefaultListModel trashListdlm = new DefaultListModel(); private DefaultListModel bidListdlm = new DefaultListModel(); private ListTransferHandler lh; private DefaultListModel lm = new DefaultListModel(); //added per Tim Huey and Netbeans.org private final Timer messageTimer; private final Timer busyIconTimer; private final Icon idleIcon; private final Icon[] busyIcons = new Icon[15]; private int busyIconIndex = 0; private LineObject line; private ArrayList lines = new ArrayList(), sequences=new ArrayList(); private Vector panelist = new Vector(); private Hashtable seqHashTable = new Hashtable(); private Hashtable lineHashTable = new Hashtable(); private String[] seqText = new String[6]; [B][COLOR="Red"]JFrame mainFrame = super.getFrame();[/COLOR][/B] private JDialog seq1Dialog = new JDialog(mainFrame,"Expanded Sequence 1 View"); private JDialog seq2Dialog = new JDialog(mainFrame,"Expanded Sequence 2 View"); private JDialog seq3Dialog = new JDialog(mainFrame,"Expanded Sequence 3 View"); private JDialog seq4Dialog = new JDialog(mainFrame,"Expanded Sequence 4 View");Last edited by TimHuey; 09-06-2009 at 05:05 AM.
-
Congrats. What you are dealing with is more than just plain Swing here but is with Java's Swing Application Framework. I think it's safe to say that most of us here build GUIs without using NetBean's GUI Builder, and so don't have to deal with this issue.
Thanks for posting your solution and look forward to seeing you here.
/Pete
- 09-06-2009, 05:21 PM #23
Member
- Join Date
- Aug 2009
- Posts
- 50
- Rep Power
- 0
Similar Threads
-
Halt applet processes.
By barusk in forum Java AppletsReplies: 1Last Post: 04-06-2009, 05:11 PM -
killing a java process
By paritoshcg in forum Advanced JavaReplies: 3Last Post: 12-01-2008, 08:16 AM -
Killing an Ill-behaved Thread
By John6715 in forum Threads and SynchronizationReplies: 6Last Post: 10-03-2008, 08:35 AM -
Thread killing
By denis in forum Threads and SynchronizationReplies: 13Last Post: 09-25-2008, 09:28 PM -
netbeans processes don´t die
By karlen in forum NetBeansReplies: 0Last Post: 06-11-2007, 09:55 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks