|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
JButton does not work in java swing I am working on Java swings. I have a case wherein I have a JButton present inside a JTable. I have also written a ButtonRenderer for the same.The problem is that whenever I place i click on the JButton created it does not open anything,the window remains still and nothing happens. How could I get rid of this.please help. |
#2
| |||
| |||
Re: JButton does not work in java swing Code: button.setOpaque(false); button.setFocusPainted(false); button.setBorderPainted(false); button.setContentAreaFilled(false); setBorder(BorderFactory.createEmptyBorder(0,0,0,0)); Rather than the JDK itself setting the border to an EmptyBorder when null is passed in, the clients should set an EmptyBorder themselves (a very easy workaround). That way there is no confusion about who's doing what in the code. |
#3
| |||
| |||
Re: JButton does not work in java swing It is on the frame but you are not working with it. You need to call the setVisible(false) to the Frame which is shown and not to the just created one. |
#4
| |||
| |||
Re: JButton does not work in java swing You need to write a cell editor in addition to the cell renderer. If you're not using a cell editor for the cell with the button, I don't see how that could be. |
![]() |
|
Tags: buttonrenderer, java swing, jbutton, jtable |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to handle JButton Click Event in Java Swing | Kungfu Pandey | Software Development | 3 | 20-01-2012 12:13 PM |
JButton to send command to Java console | Fox28 | Software Development | 6 | 21-07-2010 10:03 AM |
Print in java using Swing | Sheenas | Software Development | 3 | 18-11-2009 09:50 AM |
Java Swing and MySQL | shelton141 | Software Development | 1 | 22-09-2009 08:50 AM |
Java swing help with repaint() | grudge | Software Development | 4 | 23-07-2009 03:41 PM |