import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemListener; import java.sql.*; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; import java.io.*; import java.net.*; public class newCl extends JDialog { private JButton query = new JButton("Query"); private JLabel selectColumn = new JLabel("Select Query Column"); private JLabel enterKeyword = new JLabel("Enter Keyword"); private JComboBox comboBox = new JComboBox(); private JTextField textField = new JTextField(); private JPanel queryPanelLeft = new JPanel(); private JPanel queryPanelRight = new JPanel(); private JPanel queryPanel = new JPanel(); private int queryColumn = -1; private String queryCriteria = null; private String queryString = null; private String resultString=null; private String[] org_DataV=null; private ResultDialog dialog = null; public newCl() { } public void init() { comboBox.setPreferredSize(new Dimension(200, 25)); comboBox.addActionListener(new ComboListener()); fillCombo(); query.addActionListener(new ButtonListener()); textField.setPreferredSize(new Dimension(200, 25)); selectColumn.setPreferredSize(new Dimension(150, 25)); enterKeyword.setPreferredSize(new Dimension(150, 25)); queryPanelLeft.setLayout(new FlowLayout()); queryPanelLeft.add(selectColumn); queryPanelLeft.add(comboBox); queryPanelLeft.add(new JLabel()); queryPanelRight.setLayout(new FlowLayout()); queryPanelRight.add(enterKeyword); queryPanelRight.add(textField); queryPanelRight.add(new JLabel()); queryPanel.setLayout(new FlowLayout()); queryPanel.add(queryPanelLeft); queryPanel.add(queryPanelRight); queryPanel.add(query); this.add(queryPanel); this.setSize(400, 200); this.setResizable(false); this.setModal(true); this.setTitle("Query Dialog"); this.setVisible(true); } private void fillCombo() { comboBox.addItem("Choose"); comboBox.addItem("SEHIR"); comboBox.addItem("BTS ADI"); comboBox.addItem("RL TIPI"); comboBox.addItem("ANTEN CAPI"); comboBox.addItem("RL KARSILIGI"); comboBox.addItem("RL FREKANSI"); comboBox.addItem("KULE"); comboBox.addItem("HEIGHT"); comboBox.addItem("AZIMUTH"); comboBox.addItem("DISTANCE"); comboBox.addItem("TRANSMISSION CONNECTION"); comboBox.addItem("STATUS"); comboBox.addItem("ON AIR TARIHI"); } public static void main(String args[]) { newCl dialog = new newCl(); dialog.init(); } public int getQueryColumn() { return queryColumn; } public void setQueryColumn(int queryColumn) { this.queryColumn = queryColumn; } private class ButtonListener implements ActionListener { public void actionPerformed(ActionEvent e) { resultString=""; queryCriteria = textField.getText(); resultString+=getQueryColumn()+":"; String resp_D[] = queryCriteria.split(" "); for(int ff=0;ff