Results 1 to 2 of 2
Thread: Gain focus in JTable
- 08-04-2012, 09:12 AM #1
Member
- Join Date
- Feb 2012
- Location
- Norway
- Posts
- 96
- Rep Power
- 0
Gain focus in JTable
Hi,
I am trying to get a selected column from a jTable.
Here is my code:
And I want the first column(0) to be displayed in a label (testLabel)Java Code:private void ledgerTableFocusGained(java.awt.event.FocusEvent evt) { int selectedRow = ledgerTable.getSelectedRow(); int account = Integer.parseInt(ledgerTable.getModel().getValueAt(selectedRow, 0).toString()); Ledger ledger = new Ledger(); ledger = LedgerTable.select(account); ledger.getaccount(); String konto = Integer.toString(account); testLabel.setText(konto);
But something is wrong, but I don't see it. Can anyone tell me whats missing?
- 08-04-2012, 09:32 AM #2
Re: Gain focus in JTable
1. A clear description of what is wrong. We're not mid readers here.
2. A SSCCE (Short, Self Contained, Correct (Compilable), Example) that members here can compile and execute to identify the problem.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
In jtable the focus got to particular row when i enter any key from key board
By dinesh.guntha in forum AWT / SwingReplies: 1Last Post: 02-27-2012, 03:01 PM -
How to change the focus order of JTable
By chyrl in forum AWT / SwingReplies: 0Last Post: 05-05-2010, 02:00 PM -
JTable Cell Focus Listener
By Manfizy in forum New To JavaReplies: 1Last Post: 07-21-2009, 08:08 AM -
JComboBox in JTable and Cant get Focus...
By markw8500 in forum New To JavaReplies: 1Last Post: 03-29-2009, 11:35 PM -
JTable Focus Traversal
By helios_lie in forum AWT / SwingReplies: 1Last Post: 12-20-2007, 10:27 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks