Results 1 to 1 of 1
- 10-26-2012, 04:38 PM #1
Member
- Join Date
- Oct 2010
- Posts
- 26
- Rep Power
- 0
"Save Changes" isn't working properly
Hello, I have recently been making a program in which I've been doing it DIY. I've been using a system where I have constructors that return my main JPANEL from my original class in which the Main Method calls.
I've basically created the whole UI now, however I am now trying to add a bit of functionality to it. I have made a feature that when I click "Save Changes" and it saves to an external class in which I can retrieve data for alter usage. However, whenever I load up the JPanel it loads up the old data, however, if I click on another JPanel and then go back to it again it works =S.
That is one of my Action Listeners to switch UI panels. I simply can't wrap my head around it. It's really annoying because you have to click another button to go to another JPANEL, then you go back to the JPANEL that you saved and it returns the normal data, then when you go back again to the other JPanel and then back to the saved one it works.Java Code:/*----------------------------------------------------------------------- ------------------CHANGE PANEL LISTENER SETTINGS--------------------------- ------------------------------------------------------------------------ */ public void panelSettingsActionPerformed(ActionEvent e){ try{ frame.contentPane.remove(frame.mainPane); frame.contentPane.remove(frame.lowerPane); } catch(Exception i){ System.out.println("No Such Frame Exists"); } frame.mainPane = settingsMainContent.getContent(); frame.lowerPane = new JScrollPane(); frame.contentPane.add(settingsMainContent.getContent(), frame.contentLayout.CENTER); frame.contentPane.add(frame.lowerPane, frame.contentLayout.SOUTH); settingsMainContent = new HomeSystemSettingsHomeContent(this); frame.revalidate(); } class panelSettingsActionAdapter implements ActionListener { HomeSystemLeftMenuContent adaptee; panelSettingsActionAdapter(HomeSystemLeftMenuContent adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.panelSettingsActionPerformed(e); } } /*----------------------------------------------------------------------- ------------------------------------END--------------------------------- ------------------------------------------------------------------------ */
Just don't know =(
Similar Threads
-
Eclipse " save as ANT script" or not?
By ytrewqc in forum New To JavaReplies: 1Last Post: 08-13-2012, 08:34 PM -
Hwlp with "Open", "Save", "Save as..."
By trill in forum New To JavaReplies: 3Last Post: 11-02-2010, 09:26 AM -
JtextPane does not display properly when initialized with ""
By orfano in forum AWT / SwingReplies: 0Last Post: 04-20-2009, 11:08 AM -
the dollar sign "$", prints like any other normal char in java like "a" or "*" ?
By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 07:35 AM -
Open "Save Page As" Dialog Box
By Anubha in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 12-12-2007, 09:27 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks