File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Handling tabbedpane events Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Handling tabbedpane events" Watch "Handling tabbedpane events" New topic

Handling tabbedpane events

ali honarmand
Ranch Hand

Joined: Oct 12, 2009
Posts: 32

Hi everyone,
I'm using JTabbedPane on a JFrame. I have got two JPanels added to the JTabbedPane as my tabs. on first tab I have got a list which includes data loaded from DB. the next tab contains "Insert" function, which takes a name and inserts it to the DB(where list reads its data from). the problem is that I can not handle events to control switching between tabs to update list to show the new item inserted. Now I need your help.

thanks in prior,

A. Honarmand

I'm using JDeveloper

A. Honarmand
Darryl Burke

Joined: May 03, 2008
Posts: 5115

To get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem.

luck, db
There are no new questions, but there may be new answers.
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2447
Use a ChangeListener to know when a new tab has been selected.
I agree. Here's the link:
subject: Handling tabbedpane events
It's not a secret anymore!