|
|
| java swings |
Expert:valarmathi
Hi , I have integrated the code for jtextfield validation. If i run the code ,i am getting nullpointer exception.Please correct the code.
package com.zsl.ibm.mqtool;
import java.awt.Color; import java.awt.Font; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.Writer; import java.net.URL; import java.net.URLConnection; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Map;
import javax.swing.JButton; import javax.swing.JFileChooser; import javax.swing.JFormattedTextField; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JSplitPane; import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.UIManager; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.SAXException;
public class TabPage extends JPanel implements FocusListener, ListSelectionListener,KeyListener {
/** * */ private static final long serialVersionUID = 8496086175353972765L;
JPanel panel1, panel2;
// Panel1 JLabel jbossHostname, jbossPortno, jbossPath, jbossStatus, jbossServertitle; JLabel errorlabel;
public JTextField jbosshostNameText, jbosstPortnoText, jbossPathText, jbossStatusText;
JButton browseButton, submitButton;
String substringOfQueueTemp = "";
ArrayList selected1;
Object selected2[];
int serpos = 0;
String jbossserverstatus = null;
// Panel2 JLabel jbossActivemqLabel, jbossIbmmqLabel,activemqtitle;
JList activeMqList, ibmMqList;
JScrollPane activeMqListScrollPane, ibmMqListScrollPane;
JButton listTransferButton, jbossrefreshbutton;
String input = null;
String substr = null;
String substrloop = null;
String st = "";
StringBuilder sb = new StringBuilder();
String sbb = null;
String[] queuenamearr = new String[50]; URLConnection connection; URL url;
public JPanel jbossServerMethod() {
String searchText = "java.exe"; StringBuilder sb = new StringBuilder();
Map<String, String> env = System.getenv(); for (String envName : env.keySet()) {
} try { Runtime rt = Runtime.getRuntime(); Process proc = rt.exec(new String[] { "cmd", "/c", "start C:\\toolserver.bat" });
} catch (Throwable t) { t.printStackTrace(); }
String fileName = "c:\\tasklistservice.txt"; try { BufferedReader reader = new BufferedReader(new FileReader(fileName));
// Reads until the end-of-file met while (reader.ready()) { // Read line-by-line directly sb.append(reader.readLine()); }
} catch (IOException ex) { ex.printStackTrace(); }
String fileText = sb.toString(); // Panel 1 panel1 = new JPanel(); panel1.setBackground(Color.decode("#99CC99")); panel1.setLayout(null);
serpos = fileText.indexOf(searchText); jbossHostname = new JLabel("JBoss Server HostName"); jbosshostNameText = new JTextField(33); jbossHostname.setFont(new Font("Microsoft Sans Serif", Font.BOLD, 12)); panel1.add(errorlabel); errorlabel.setBounds(490, 180, 300, 20); jbosshostNameText.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent EVT) { if (EVT.getKeyChar() >= '0' && EVT.getKeyChar() <= '9' || EVT.getKeyCode() == 8) { jbosshostNameText.setEditable(true); errorlabel.setText(""); } else { jbosshostNameText.setEditable(false); ; errorlabel.setText("* Enter only numeric characters"); } } }); jbossPortno = new JLabel("JBoss Server PortNumber"); jbosstPortnoText = new JTextField(33); jbosstPortnoText.addFocusListener(this); jbosstPortnoText.setText("0"); jbosstPortnoText.setEditable(true); jbossPortno.setFont(new Font("Microsoft Sans Serif", Font.BOLD, 12));
jbossPath = new JLabel("JBoss Server Path"); jbossPathText = new JTextField(33); jbossPath.setFont(new Font("Microsoft Sans Serif", Font.BOLD, 12));
jbossStatus = new JLabel("JBoss Server Status"); jbossStatusText = new JTextField(33); jbossStatusText.setEditable(false); jbossStatusText.setText(jbossserverstatus); jbossStatus.setFont(new Font("Microsoft Sans Serif", Font.BOLD, 12));
jbossServertitle = new JLabel("JBoss Server Details"); jbossServertitle.setFont(new Font("Microsoft Sans Serif", Font.BOLD, 16)); jbossServertitle.setForeground(Color.decode("#660033")); jbossServertitle.setBounds(190, 40, 170, 20);
browseButton = new JButton("BROWSE"); submitButton = new JButton("SUBMIT");
panel1.add(jbossServertitle);
panel1.add(jbossHostname); panel1.add(jbosshostNameText); jbossHostname.setBounds(90, 100, 180, 14); jbosshostNameText.setBounds(290, 100, 180, 20); jbosshostNameText.setToolTipText("Please enter the valid hostname on which the JBoss Server Running"); panel1.add(jbossPortno); panel1.add(jbosstPortnoText);
jbossPortno.setBounds(90, 140, 180, 14); jbosstPortnoText.setBounds(290, 140, 180, 20); jbosstPortnoText.setToolTipText("Please enter the valid port number on which the JBoss Server Running");
panel1.add(jbossPath); panel1.add(jbossPathText); jbossPath.setBounds(90, 180, 180, 14); jbossPathText.setBounds(290, 180, 180, 20); jbossPathText.setToolTipText("Please set the valid JBoss Server Path");
panel1.add(browseButton); browseButton.setToolTipText("Please select the valid JBoss Server Path"); browseButton.setBounds(490, 180, 87, 20); browseButton.setMnemonic('B'); browseButton.setBackground(Color.decode("#660033")); browseButton.setForeground(Color.decode("#FFFFFF")); ActionListener browseLis = new ActionListener() { public void actionPerformed(ActionEvent ae) { JOptionPane.showMessageDialog(browseButton, "Please select the JBossSever Path", "", 1); JFileChooser chooser = new JFileChooser(); int returnVal = chooser.showOpenDialog(null); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); File file = null; if (returnVal == JFileChooser.APPROVE_OPTION) { file = chooser.getSelectedFile(); String filename = file.getAbsolutePath(); jbossPathText.setText(filename);
} }
}; browseButton.addActionListener(browseLis);
panel1.add(jbossStatus); panel1.add(jbossStatusText); jbossStatus.setBounds(90, 220, 160, 14); jbossStatusText.setToolTipText("Check whether the JBoss server is started or not"); jbossStatusText.setBounds(290, 220, 180, 20);
submitButton = new JButton("SUBMIT"); panel1.add(submitButton); submitButton.setToolTipText("Submit the JBoss ActiveMQ Queues details"); submitButton.setBounds(360, 270, 90, 21); submitButton.setMnemonic('S'); submitButton.setBackground(Color.decode("#660033")); submitButton.setForeground(Color.decode("#FFFFFF")); panel1.setBackground(Color.decode("#99CC99")); ActionListener submitLis = new ActionListener() { public void actionPerformed(ActionEvent ae) {
String xmlPath = jbossPathText.getText(); if (xmlPath.length() > 0) { listDisplay(xmlPath.replace("\\", "/")); } else { Object obj[] = new Object[1]; obj[0] = ""; activeMqList.setListData(obj); } JOptionPane.showMessageDialog(submitButton,
"Active MQ Queues Are Displayed", "Migration Queue", 1); }
}; submitButton.addActionListener(submitLis); return panel1;
}
public void focusGained(FocusEvent arg0) {
}
public void focusLost(FocusEvent fe) { displayMessage("Focus Lost", fe); } void displayMessage(String prefix, FocusEvent e) {
String textjbosshostname = jbosshostNameText.getText(); jbosshostNameText.setText(textjbosshostname); String textjbossport = String.valueOf(jbosstPortnoText.getText().trim()); int textjbossportnumber = Integer.parseInt(textjbossport); try { browseButton.setEnabled(true); submitButton.setEnabled(true); URL url = new URL("http://"+textjbosshostname+":"+textjbossportnumber+"/jmx-console/"); URLConnection connection = url.openConnection(); if (!(connection.getContentType() != null)) { jbossserverstatus = "JBoss Server NOT Started"; jbossStatusText.setText(jbossserverstatus); jbossPathText.setEditable(false); browseButton.setEnabled(false); submitButton.setEnabled(false); } else { if(textjbossportnumber == url.getPort()) { jbossserverstatus = "JBoss Server is Started"; jbossStatusText.setText(jbossserverstatus); jbossPathText.setEditable(true); } else { jbossserverstatus ="Server Started But Port Mismatch"; jbossStatusText.setText(jbossserverstatus); jbossPathText.setEditable(true); } } } catch (Exception e1) { }
}
// void displayMessage(String prefix, FocusEvent e) { // System.out.println("Hai"); // String textjbosshostname = jbosshostNameText.getText(); // jbosshostNameText.setText(textjbosshostname); // String textjbossport = String.valueOf(jbosstPortnoText.getText().trim()); // int textjbossportnumber = Integer.parseInt(textjbossport); // System.out.println("Hai"+textjbosshostname); // try { // URL url1 = new URL("http://"+textjbosshostname+":8080/jmx-console/"); // URLConnection connection1 = url1.openConnection(); // System.out.println("Get host"+url1.getHost()); // System.out.println("Get value" + connection1.getContentType().toString()); // if (!(connection1.getContentType() != null)) { // // jbossserverstatus = "JBoss Server NOT Started"; // jbossStatusText.setText(jbossserverstatus); // jbossPathText.setEditable(false); // jbossPathText.setText(null); // submitButton.setEnabled(false); // browseButton.setEnabled(false); // } // else // { // if(textjbossportnumber == 8080) // { // jbossserverstatus = "JBoss Server is Started"; // jbossStatusText.setText(jbossserverstatus); // jbossPathText.setEditable(true); // submitButton.setEnabled(true); // browseButton.setEnabled(true); // // } // else // { // jbossserverstatus ="JBoss Port Mismatch"; // jbossStatusText.setText(jbossserverstatus); // jbossPathText.setEditable(false); // submitButton.setEnabled(false); // browseButton.setEnabled(false); // } // } // // } catch (Exception e1) { // System.out.println("Exception "+e1.getMessage().toString()); // } // }
public JPanel activeMQtoIBMMQMethod() { // Panel 2 panel2 = new JPanel(); panel2.setLayout(null); panel2.setBackground(Color.decode("#99CC99"));
activemqtitle=new JLabel("MIGRATION OF ACTIVE MQ TO IBM MQ"); panel2.add(activemqtitle); activemqtitle.setBounds(190, 40, 260, 24); activemqtitle.setForeground(Color.decode("#660033")); activemqtitle.setFont(new Font("Microsoft Sans Serif", Font.BOLD,12)); jbossActivemqLabel = new JLabel("Active MQ"); panel2.add(jbossActivemqLabel); jbossActivemqLabel.setFont(new Font("Microsoft Sans Serif", Font.BOLD,12)); jbossActivemqLabel.setBounds(120, 90, 160, 14);
jbossIbmmqLabel = new JLabel("IBM MQ"); panel2.add(jbossIbmmqLabel); jbossIbmmqLabel.setFont(new Font("Microsoft Sans Serif", Font.BOLD, 12)); jbossIbmmqLabel.setBounds(380, 90, 160, 14);
listTransferButton = new JButton(">>"); listTransferButton.setBackground(Color.decode("#660033")); listTransferButton.setForeground(Color.decode("#FFFFFF")); panel2.add(listTransferButton); listTransferButton.setBounds(270, 180, 50, 20); listTransferButton.setMnemonic('>'); listTransferButton.setFont(new Font("Microsoft Sans Serif", Font.BOLD,12));
listTransferButton.setToolTipText("Migrate the ActiveMq To IBMMQ"); jbossrefreshbutton = new JButton("Refresh"); panel2.add(jbossrefreshbutton); jbossrefreshbutton.setBounds(330, 310, 100, 20); jbossrefreshbutton.setMnemonic('R'); jbossrefreshbutton.setBackground(Color.decode("#660033")); jbossrefreshbutton.setForeground(Color.decode("#FFFFFF")); jbossrefreshbutton.setFont(new Font("Microsoft Sans Serif", Font.BOLD, 12));
ActionListener transferLis = new ActionListener() { public void actionPerformed(ActionEvent ae) {
try { Runtime rt1 = Runtime.getRuntime(); Process proc1 = rt1.exec(new String[] { "cmd", "/c", "start C:\\zconnqmanager.bat" }); } catch (Throwable t) { t.printStackTrace(); } String fileName = "c:\\qmanager.txt"; try { StringBuilder sb = new StringBuilder(); StringBuffer displayqmrlist = new StringBuffer(); String sbb = null; StringBuilder sb1 = new StringBuilder(); BufferedReader reader = new BufferedReader(new FileReader( fileName)); while (reader.ready()) { sb.append(reader.readLine()); } substrloop = sb.toString(); int oddnumber = 0; int increment = 0; while (substrloop.length() > 0) { int serpos = substrloop.toString().indexOf("("); int str = substrloop.toString().indexOf(")"); if (oddnumber == 0) { substr = substrloop.substring(serpos + 1, str); substrloop = substrloop.substring(str + 1, substrloop.toString().length()); oddnumber = oddnumber + 1; } else { String substr1 = substrloop.substring(serpos + 1, str); if (substr1.equals("Running")) { displayqmrlist.append(substr + "\n"); increment++; }
substrloop = substrloop.substring(str + 1, substrloop.toString().length()); oddnumber = oddnumber - 1; } } st = displayqmrlist.toString(); } catch (IOException ex) { ex.printStackTrace(); } Object selected[] = activeMqList.getSelectedValues(); for (int j = 0; j < selected.length; j++) { if (selected1.size() > 0) { for (int l = 0; l < selected1.size(); l++) { if (selected1.contains(selected[j])) { optionPaneErrorMsg(ae); break; } } for (int k = 0; k < selected1.size(); k++) { if (!selected1.contains(selected[j])) { comboOptionPane(ae); if (input != null) { createQueueInQM(input, selected[j].toString()); JOptionPane.showMessageDialog(listTransferButton,
""+ selected[j] + " Queue is Created in the " +input + " Queue Manager", "Migration Queue", 1); selected1.add(selected[j]); optionPane(ae); } else { comboOptionPaneList(ae); break; }
} } } else {
comboOptionPane(ae);
if (input != null) { createQueueInQM(input, selected[j].toString()); JOptionPane.showMessageDialog(listTransferButton,
""+ selected[j] + " Queue is Created in the " +input + " Queue Manager", "Migration Queue", 1); selected1.add(selected[j]); optionPane(ae); } else { comboOptionPaneList(ae); break; }
} } for (int i = 0; i < selected1.size(); i++) {
selected2[i] = selected1.get(i); } ibmMqList.setListData(selected2); } }; listTransferButton.addActionListener(transferLis);
activeMqList = new JList(); activeMqListScrollPane = new JScrollPane(activeMqList); activeMqListScrollPane.setBounds(90, 125, 160, 150); panel2.add(activeMqListScrollPane);
ibmMqList = new JList(); ibmMqListScrollPane = new JScrollPane(ibmMqList); ibmMqListScrollPane.setBounds(340, 125, 160, 150); panel2.add(ibmMqListScrollPane); jbossrefreshbutton.setToolTipText("Refresh the Queue Name in the List"); ActionListener jbossRefreshLis = new ActionListener() {
public void actionPerformed(ActionEvent ae) { try { comboOptionPane(ae);
Runtime rt = Runtime.getRuntime(); Process proc = rt.exec(new String[] { "cmd", "/c", "start C:\\displayQueuesFromQM.bat", input }); String fileName = "c:\\displayqueuesQM.txt";
BufferedReader reader = new BufferedReader(new FileReader( fileName)); Object listdata[] = new Object[100]; int i = 0; // Reads until the end-of-file met while (reader.ready()) { // Read line-by-line directly String str = reader.readLine(); int stapos = str.toString().indexOf("QUEUE("); int endpos = str.toString().indexOf(")");
if (stapos > 1 && endpos > 1) { String queuename = str .substring(stapos + 6, endpos);
if (!(queuename.startsWith("SYSTEM"))) { if (!(queuename.startsWith("AMQ"))) {
// sb.append(queuename); listdata[i] = queuename; i++; } } } int pos = str.toString().indexOf("AMQ8118");
if (pos >= 0) { }
} ibmMqList.setListData(listdata); } catch (Exception ex) {
}
}
}; jbossrefreshbutton.addActionListener(jbossRefreshLis);
return panel2; }
// create queue started public void createQueueInQM(String QueueManagerName, String LocalQueueName) { String path = "ALTER QMGR +\n" +
"AUTHOREV(ENABLED) +\n" +
"LOCALQ('" + LocalQueueName + "') +\n" +
"DEFXMITQ(' ') +\n" +
"DESCR('Facilities Local TEST QMgr') +\n" +
"INHIBTEV(ENABLED) +\n" +
"LOCALEV(ENABLED) +\n" +
"MAXHANDS(256) +\n" +
"MAXUMSGS(10000) +\n" +
"PERFMEV(ENABLED) +\n" +
"REMOTEEV(DISABLED) +\n" +
"STRSTPEV(ENABLED) +\n" +
"TRIGINT(999999999) +\n" +
"MAXMSGL(4194304) +\n" +
"CHAD(DISABLED) +\n" +
"CHADEV(DISABLED) +\n" +
"CHADEXIT(' ') +\n" +
"CLWLEXIT(' ') +\n" +
"CLWLDATA(' ') +\n" +
"REPOS(' ') +\n" +
"REPOSNL(' ') +\n" +
"CLWLLEN(100) +\n" +
"SSLCRLNL (' ') +\n" +
"SSLCRYP (' ') +\n" +
"FORCE\n" +
"DEFINE QLOCAL ('" + LocalQueueName + "') +\n" +
"DESCR('Dead Letter Queue') +\n" +
"PUT(ENABLED) +\n" +
"DEFPRTY(0) +\n" +
"DEFPSIST(YES) +\n" +
"SCOPE(QMGR) +\n" +
"GET(ENABLED) +\n" +
"MAXDEPTH(5000) +\n" +
"MAXMSGL(4194304) +\n" +
"SHARE +\n" +
"DEFSOPT(SHARED) +\n" +
"MSGDLVSQ(PRIORITY) +\n" +
"HARDENBO +\n" +
"USAGE(NORMAL) +\n" +
"NOTRIGGER +\n" +
"TRIGTYPE(FIRST) +\n" +
"TRIGDPTH(1) +\n" +
"TRIGMPRI(0) +\n" +
"TRIGDATA(' ') +\n" +
"PROCESS(' ') +\n" +
"INITQ(' ') +\n" +
"RETINTVL(999999999) +\n" +
"BOTHRESH(0) +\n" +
"BOQNAME(' ') +\n" +
"QDEPTHHI(80) +\n" +
"QDEPTHLO(20) +\n" +
"QDPMAXEV(ENABLED) +\n" +
"QDPHIEV(DISABLED) +\n" +
"QDPLOEV(DISABLED) +\n" +
"QSVCINT(999999999) +\n" +
"QSVCIEV(NONE) +\n" +
"DISTL(NO) +\n" +
"CLUSTER(' ') +\n" +
"CLUSNL(' ') +\n" +
"DEFBIND(OPEN) +\n" +
"REPLACE";
try {
Writer output = null; File file = new File( "C:\\Program Files\\IBM\\WebSphere MQ\\bin\\zconn.mqs"); output = new BufferedWriter(new FileWriter(file)); output.write(path); output.close(); } catch (IOException e) { }
try { Runtime rt = Runtime.getRuntime(); Runtime rt1 = Runtime.getRuntime(); Process proc = rt.exec(new String[] { "cmd", "/c", "start C:\\queuecreationqm.bat", QueueManagerName }); Process proc1 = rt1.exec(new String[] { "cmd", "/c", "start C:\\zconnqmanager.bat" }); } catch (Throwable t) { t.printStackTrace(); } String fileName = "c:\\qmanager.txt"; try { StringBuilder sb = new StringBuilder(); String sbb = null; StringBuilder sb1 = new StringBuilder(); BufferedReader reader = new BufferedReader(new FileReader(fileName));
// Reads until the end-of-file met while (reader.ready()) { // Read line-by-line directly
sb.append(reader.readLine()); } String substrloop = null; substrloop = sb.toString(); int oddnumber = 0; while (substrloop.length() > 0) {
int serpos = substrloop.toString().indexOf("("); int str = substrloop.toString().indexOf(")"); if (oddnumber == 0) { String substr = substrloop.substring(serpos + 1, str); substrloop = substrloop.substring(str + 1, substrloop .toString().length()); oddnumber = oddnumber + 1; } else { String substr = substrloop.substring(serpos + 1, str); substrloop = substrloop.substring(str + 1, substrloop .toString().length()); oddnumber = oddnumber - 1; } } } catch (IOException ex) { ex.printStackTrace(); } }
// create queue ended public void listDisplay(String xmlPath) { if (xmlPath.length() > 0) { DocumentBuilderFactory factory = DocumentBuilderFactory .newInstance(); factory.setNamespaceAware(true); DocumentBuilder builder = null;
try { builder = factory.newDocumentBuilder(); } catch (ParserConfigurationException e) { e.printStackTrace(); } Document doc = null; try { doc = builder.parse(xmlPath); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } NodeList list = doc.getElementsByTagName("mbean"); String substringofQueue[] = new String[list.getLength()]; selected1 = new ArrayList(); selected2 = new Object[list.getLength()]; for (int i = 0; i < list.getLength(); i++) {
Node node = list.item(i); String str = node.getAttributes().getNamedItem("name") .toString(); int startpoint = str.indexOf("Queue,name"); if (startpoint > 0) { String substr = str.substring(startpoint, str.toString() .length()); int startpointnextlevel = substr.indexOf("name="); substringOfQueueTemp = substr.substring( startpointnextlevel + 5, substr.toString().length() - 1); substringofQueue[i] = substringOfQueueTemp; }
}
activeMqList.setListData(substringofQueue);
} else { // System.out.println("No Url");
} }
public void comboOptionPaneList(ActionEvent ae) { String str = ae.getActionCommand();
// UIManager.put("OptionPane.Foreground", Color.green); // UIManager.put("Panel.background", Color.green); if (str.equals(">>")) { int time = 0; while (true) { time = 5; break; } time *= 1000; try { Thread.sleep(time);
JOptionPane.showMessageDialog(listTransferButton,
"Please select the Queue Manager Name", "Migration Queue", 1); } catch (Exception e) { }
} }
public void comboOptionPane(ActionEvent ae) {
String[] arr = st.split("\n"); // System.out.println("st value" + st); input = (String) JOptionPane.showInputDialog(TabPage.this, "Please select the Queue Manager", "", JOptionPane.INFORMATION_MESSAGE, null, arr, "Tennis");
JOptionPane.showMessageDialog(null, "Selected Queue Manager Name: " + input);
}
public void optionPane(ActionEvent ae) {
String str = ae.getActionCommand();
// UIManager.put("OptionPane.Foreground", Color.green); // UIManager.put("Panel.background", Color.green); if (str.equals(">>")) { int time = 0; while (true) { time = 5; break; } time *= 1000; try { Thread.sleep(time);
JOptionPane.showMessageDialog(listTransferButton,
"Succesfully Migrated the Active MQ to IBM MQ", "Migration Queue", 1); } catch (Exception e) { }
}
}
public void optionPaneErrorMsg(ActionEvent ae) {
String str = ae.getActionCommand();
if (str.equals(">>")) { int time = 0; while (true) { time = 3; break; } time *= 1000; try { Thread.sleep(time); JOptionPane.showConfirmDialog(listTransferButton, "Queue Name Already Exists.Do You Want to Overrite", "Queue Name Exists", JOptionPane.ERROR_MESSAGE); } catch (Exception e) { } }
}
private JList list;
public JPanel splitpane() { JPanel panel4 = new JPanel(); JPanel panel5 = new JPanel(); JPanel panel6 = new JPanel(new GridLayout(1, 1));
description = new JTextArea(); list = new JList(texts); list.addListSelectionListener(this); list.setBackground(Color.decode("#99CC99")); list.setBounds(190, 40, 200, 20); description.setBounds(230, 140, 200, 50); description.setBackground(Color.decode("#99CC99")); panel4.setBackground(Color.decode("#99CC99")); panel4.add(list);
panel5.setBackground(Color.decode("#99CC99")); panel5.add(description);
final JSplitPane jSplitPane = new JSplitPane(); jSplitPane.setLeftComponent(panel4); jSplitPane.setRightComponent(panel5); jSplitPane.setContinuousLayout(true); panel6.add(jSplitPane); return panel6;
}
public void valueChanged(ListSelectionEvent event) { JList source = (JList) event.getSource(); Disp value = (Disp) source.getSelectedValue(); description.setText(value.getDescription()); }
private JTextArea description;
private Disp[] texts = { new Disp( "Environment"," Environment Information\n" +" \n * JBOSS Server \n\n * IBM MQ 6.0 version \n\n * JDK1.4 or above\n\n" + " System Information \n\n * WindowsXP/Windows98,Windows 2003 \n\n * 2GB RAM \n\n * 80GB Harddisk\n"), new Disp( "\n\n\n\n\n\nOS Verification"," OS Information\n" +"\n * Current O.S information will display \n\n * Using System class of JDK API.We are able to display all O.S information \n\n" + " * JVM Verification\n "), new Disp( "\n\n\n\n\n\nMQ Server Verification"," MQ Server Information\n"+ "\n * Batch File will display all Active Services and store it into the File\n\n a) toolservice.bat\n " + " b) toolservicepath.bat\n\n * Search the Service in the File\n\n a) servicelist.txt\n b)servicelistpath.txt\n\n * Verify the Server is started or Not\n\n * Display the IBM MQ Status in the Screen"), new Disp("\n\n\n\n\n\nJBoss Server Verification"," JBoss Server Information\n"+ "\n * Batch File will display all active process EXE Files \n\n a) toolserver.bat \n\n * search the Service in the File \n\n " + " a) Tasklistservice.txt \n\n * Server Name,Port No,Path given by user \n\n * Verify the Server is started or Not \n"), new Disp("\n\n\n\n\n\nCreate Queue Manager"," Create Queue Manager\n"+ "\n * User Can create Queue Manager dynamically \n"), new Disp("Migration Queues"," ActiveMQ To IBMMQ Migration\n"+ "\n Migration of Queues from ActiveMQ to IBM MQ \n\n * Display all Queues from JBOSS Server,if the JBOSS server \n xml file is present in valid path.\n\n " + "* Select a Queue to Migrate from ActiveMQ to IBM MQ \n\n * click on >> Button, User will select the Queue Manager after \n that selected Queue will store into the QueueManager of IBM MQ \n\n " + " * If user will click on Refresh button.System will ask the QueueManager name.\n Once if the user will give the queuemanager. Corresponding Queues \n from the QueueManager will display \n\n" + " * while doing migration,if Queues are already created in IBM MQ.\n System should display the Error Message") };
public void keyPressed(KeyEvent arg0) { // TODO Auto-generated method stub }
public void keyReleased(KeyEvent arg0) { // TODO Auto-generated method stub }
public void keyTyped(KeyEvent arg0) { // TODO Auto-generated method stub }
}
class Disp { public Disp(String n, String t) { name = n; des = t; }
public String toString() { return name; }
public String getDescription() { return des; }
private String name;
private String des; /*About */ }
this is very very urgent.... please..........
Thanks, Valarmathi |
| Answers |
| More Questions |
|
|
Post Answers
Ask Question
Facing Programming Problem?
|
|
|
|
|