in the following code :
import java.awt.* ;
import java.awt.event.* ;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.table.*;
import java.util.*;
public class CallTiketPnl extends JPanel {
/** Creates a new instance of CallTiketPnl */
public CallTiketPnl() {
super();
jTblRes.setModel(new javax.swing.table.DefaultT
ableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
// These to lines corect the problem but the hightlighting is not corect.
//jCmbBxIn.setLightWeightP
opupEnable
d(false);
jCmbBxIn.setBackground(Col
or.WHITE);
jCmbBxIn.setModel(new javax.swing.DefaultComboBo
xModel(new
String[] { "numero de série", "pin code", "pays", "N° de téléphone" }));
//jCmbBxIn.setDoubleBuffer
ed(true);
setLayout(new GridBagLayout());
setBackground(Color.WHITE)
;
gbc.gridx = gbc.gridy = 0;
add(jLblSearch, gbc);
gbc.gridx++;
gbc.fill = GridBagConstraints.HORIZON
TAL;
gbc.weightx = 1.0;
add(jTxtFldSearch, gbc);
gbc.fill = GridBagConstraints.NONE;
gbc.weightx = 0;
gbc.gridx++;
add(jLblIn, gbc);
gbc.gridx++;
add(jCmbBxIn, gbc);
gbc.gridx++;
jBtnSearch.setBackground(C
olor.WHITE
);
add(jBtnSearch, gbc);
gbc.gridx = 0;
gbc.gridy++;
gbc.gridwidth = 5;
gbc.fill = java.awt.GridBagConstraint
s.BOTH;
gbc.weightx = gbc.weighty = 1.0;
add(jTblRes, gbc);
jBtnPrint.setBackground(Co
lor.WHITE)
;
gbc.gridwidth = 0;
gbc.fill = java.awt.GridBagConstraint
s.NONE;
gbc.weightx = gbc.weighty = 0;
gbc.gridx = 4;
gbc.gridy++;
add(jBtnPrint, gbc);
}
public static void main(String[]args)
{
JFrame tstf =new JFrame("test");
tstf.getRootPane().setLayo
ut(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx= gbc.gridy = 0;
gbc.fill = java.awt.GridBagConstraint
s.BOTH;
gbc.fill=gbc.BOTH;
gbc.weightx=gbc.weighty=1;
tstf.getRootPane().add(new
CallTiketPnl(),gbc);
tstf.pack();
tstf.show();
tstf.setDefaultCloseOperat
ion(tstf.E
XIT_ON_CLO
SE);
}
GridBagConstraints gbc= new GridBagConstraints();
JLabel jLblSearch = new JLabel("Search");
JTextField jTxtFldSearch = new JTextField();
JLabel jLblIn = new JLabel(" in ");
JComboBox jCmbBxIn = new JComboBox();
JTable jTblRes = new JTable();
JButton jBtnSearch = new JButton("Go");
JButton jBtnPrint = new JButton("Print");
}
the combo box did not open the popup until the fram is resised to be small.
please help;-)