Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JButton in JTableHeader

Status
Not open for further replies.

Grentis

Programmer
Aug 18, 2003
13
IT
Hello,

how can I put a JButton in my JTableHeader?
I don't know how show the button pression/release...

Someone can help me or tell me a link about this?

Tanks
Grentis
 
You need a class which implements the java.awt.event.ActionListener class. This will receieve notifications about button clicks using the actionPerformed() method. You can use something like

Code:
JButton b = ...

...

public void actionPerformed(ActionEvent e) {
  if (e.getSource() == b) {
      // button clicked
   } 
}
 
Yes, but the button in the Header don't change its style...
it doesn't appear as someone click on it...

Grentis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top