there are two panel in one panel there is search button and in the another one there is Jtable for displaying search result. In that jtable initially all the records are displayed. But when i try to search, it works but the problem is that i need to click search button two times for searching 1st time and from second time onwards it works normally means even with single click results are displayed properly. what mistake am i making ? please suggest.
one mistake you are making, is that we don't see any of the relevant code, so it's impossible for us to see whether there's something 'odd' in it.
this is my code snippet for updating jtable where "data" is vector storing the records.
String name = nameField.getText(); ExistingStaffPanel.recordTable.setModel(new javax.swing.table.DefaultTableModel(ExistingStaffPanel.data, ExistingStaffPanel.header)); ExistingStaffPanel.data = admin.searchStaff(name); ExistingStaffPanel.recordTable.repaint();
you set the contents of your table before you set the contents that should go in there.
switch the second and third line, and try again.
did this solve the issue?
Thanx its working :)
How to connect device scanner with visual basic, its analogy I made button scan in vb and typing button scan in press scanner live and walk .. how? Help ...
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then For Each subCtrl As Control In ctrl.Controls If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then MsgBox(subCtrl.Text) End If If subCtrl.GetType Is ...
I am trying to write some code for project euler problem 10, in which you are required to find the sum of all the prime numbers less than 2 million. ...