• 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

In JTabbedPane, updation of database values not working

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have got a serious pblm. I have got a JFrame consisting of JTabbedPanes. Each JTabbedPane is used as a panel.
Eg.
JTabbedPane tp = new JTabbedPane();
tp.addTab("Add New Mgmt Rep QC Rep",new AddMgmtQC());
tp.addTab("Modify Mgmt Rep QC Rep",new ModifyMgmtQC());
class AddMgmtQC extends JPanel implements ActionListener
{
constructor()
{
// code
}
public void actionPerformed()
{
// code
}

}
class ModifyMgmtQC extends JPanel implements ActionListener
{

constructor()
{
// code
}
public void actionPerformed()
{
// code
}

}
The problem is that in "AddMgmtQC JTabbed Pane" some values are entered from the user and sent to the database. When I go to " ModifyMgmtQC JTabbed Pane" the values entered from "AddMgmtQC JTabbed Pane" should be displayed for further processing. But the values are not displayed.
I have to run the Java pgm once again to view the user values. Is there any method through which simultaneous updation can take place?
with warm regards,
Arun.
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just get the values from the components on the first screen and use them to set the values of the components on the second screen. Or am I missing something here?
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, for 1, u could popup a message to to tell u if the information has being written to the database.
2. if the information is in the database, check the statements used to retrieve the information
3. if the statements are correct, try to call the validate() method on the tab pane. This should work
 
Arun Martin
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Cindy,
It was a very good alternative suggested by u. That's precisely what I needed. But even then I am still puzzled by the fact,while the data is inserted property into the table,why at the same time the data is not being retrieved?.
This simultaneous updation of values,is this a general pblm with Java
(where one has to run the pgm once again) or is it my programming logic flaw?
with warm regards,
Arun.
 
Cindy Glass
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java handles it the same way MOST programming languages handle it. The components on the first screen are not the same as the ones on the second screen and are in do way related to the fields in the database. Doing I/O on the database does not define what the value of the stuff you are displaying should be, as a programmer you have to specify that for each component.
 
If you look closely at this tiny ad, you will see five bicycles and a naked woman:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic