• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Save Problem bcz of Diff Panels

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have three tabs (image buttons), on each tab I have gui desinged with( radio buttons and text boxes). so each tab has a Panel and each Panel has a 'Save' Button. So when I load the gui with all the existing data from database Panel one loads up and I make changes in Panel one click Save..FAILS bcz i dont get the radio button data from the other two panels so the save fails. I am using the following method to get the radio button selected. All the code is one one Java file only.
public static JRadioButton getSelection(ButtonGroup group) {
for (Enumeration e=group.getElements(); e.hasMoreElements(); ) {
JRadioButton b = (JRadioButton)e.nextElement();
if (b.getModel() == group.getSelection()) {
return b;
}
}
return null;
}
Please suggest how to solve this problem.
 
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since the data in the tabs are dependent on each other it would make more sense to have one save button for everything (at the bottom), surely?

Also, are you trying to save the JRadioButton itself or the data it represents? I think part of this problem could be solved by a deeper look at M-V-C.
 
reply
    Bookmark Topic Watch Topic
  • New Topic