*
The moose likes Java in General and the fly likes In JTabbedPane, updation of database values not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "In JTabbedPane, updation of database values not working" Watch "In JTabbedPane, updation of database values not working" New topic
Author

In JTabbedPane, updation of database values not working

Arun Martin
Ranch Hand

Joined: Dec 01, 2000
Posts: 64
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.
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
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?


"JavaRanch, where the deer and the Certified play" - David O'Meara
Big Mike
Greenhorn

Joined: Jul 17, 2001
Posts: 4
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

Joined: Dec 01, 2000
Posts: 64
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"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: In JTabbedPane, updation of database values not working
 
Similar Threads
Can I use repaint() on a JFrame?
Making JTabbed Pane visible???
JTextField : setText() is not working. getText() is working
In JTabbedPane, updation of database values not working
JTextField : setText() is not working. getText() is working