File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

In JTabbedPane, updation of database values not working

 
Arun Martin
Ranch Hand
Posts: 64
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • 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?
 
Big Mike
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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"
Sheriff
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic