• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

invalid use of "this" selector syntax

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I keep getting the error "invalid use of 'this' selector syntax" while trying to compile the class attached below. Please help as to why. Thanks.

package com.teoco.GenSequences;
import java.util.Hashtable;
import java.util.Vector;
import java.util.Enumeration;
/**
*
* @author akbarw
* @version
*/
public class NewExceptions extends javax.swing.JDialog {
/** Creates new form NewExceptions */
public NewExceptions(java.awt.Frame parent, boolean modal, Hashtable exceptions) {
super (parent, modal);
initComponents ();
pack ();
myExceptionsHash = exceptions;
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the FormEditor.
*/
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jPanel2 = new javax.swing.JPanel();
jLabel6 = new javax.swing.JLabel();
jPanel5 = new javax.swing.JPanel();
jLabel7 = new javax.swing.JLabel();
jSeqName = new javax.swing.JTextField();
jPanel6 = new javax.swing.JPanel();
jLabel8 = new javax.swing.JLabel();
jSeqTable = new javax.swing.JTextField();
jPanel8 = new javax.swing.JPanel();
jLabel9 = new javax.swing.JLabel();
jSeqField = new javax.swing.JTextField();
jPanel3 = new javax.swing.JPanel();
jLabel10 = new javax.swing.JLabel();
jPanel9 = new javax.swing.JPanel();
jLabel11 = new javax.swing.JLabel();
jExceptionTableOne = new javax.swing.JTextField();
jPanel10 = new javax.swing.JPanel();
jLabel12 = new javax.swing.JLabel();
jExceptionFieldOne = new javax.swing.JTextField();
jPanel11 = new javax.swing.JPanel();
jLabel13 = new javax.swing.JLabel();
jExceptionTableTwo = new javax.swing.JTextField();
jPanel4 = new javax.swing.JPanel();
jPanel12 = new javax.swing.JPanel();
jLabel14 = new javax.swing.JLabel();
jExceptionFieldTwo = new javax.swing.JTextField();
jPanel13 = new javax.swing.JPanel();
jLabel15 = new javax.swing.JLabel();
jExceptionTableThree = new javax.swing.JTextField();
jPanel14 = new javax.swing.JPanel();
jLabel16 = new javax.swing.JLabel();
jExceptionFieldThree = new javax.swing.JTextField();
jPanel31 = new javax.swing.JPanel();
jPanel32 = new javax.swing.JPanel();
jOkButton = new javax.swing.JButton();
jCreateXML = new javax.swing.JButton();
jExitButton = new javax.swing.JButton();
getContentPane().setLayout(new java.awt.BorderLayout(10, 10));
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
closeDialog(evt);
}
}
);

jPanel1.setLayout(new java.awt.GridLayout(3, 1));

jPanel2.setLayout(new java.awt.GridLayout(4, 1));

jLabel6.setText("SEQUENCES");
jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jPanel2.add(jLabel6);


jPanel5.setLayout(new java.awt.GridLayout(1, 2));

jLabel7.setText("Sequence Name");
jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
jPanel5.add(jLabel7);


jSeqName.setColumns(15);
jPanel5.add(jSeqName);

jPanel2.add(jPanel5);


jPanel6.setLayout(new java.awt.GridLayout(1, 2));

jLabel8.setText("Sequence Table");
jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
jPanel6.add(jLabel8);


jSeqTable.setColumns(15);
jPanel6.add(jSeqTable);

jPanel2.add(jPanel6);


jPanel8.setLayout(new java.awt.GridLayout(1, 2));

jLabel9.setText("Sequence Field");
jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
jPanel8.add(jLabel9);


jSeqField.setColumns(15);
jPanel8.add(jSeqField);

jPanel2.add(jPanel8);

jPanel1.add(jPanel2);


jPanel3.setLayout(new java.awt.GridLayout(4, 1));

jLabel10.setText("EXCEPTION TABLES");
jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jPanel3.add(jLabel10);


jPanel9.setLayout(new java.awt.GridLayout(1, 2));

jLabel11.setText("Exception Table");
jPanel9.add(jLabel11);


jExceptionTableOne.setColumns(15);
jPanel9.add(jExceptionTableOne);

jPanel3.add(jPanel9);


jPanel10.setLayout(new java.awt.GridLayout(1, 2));

jLabel12.setText("Exception Field");
jPanel10.add(jLabel12);


jExceptionFieldOne.setColumns(15);
jPanel10.add(jExceptionFieldOne);

jPanel3.add(jPanel10);


jPanel11.setLayout(new java.awt.GridLayout(1, 2));

jLabel13.setText("Exception Table");
jPanel11.add(jLabel13);


jExceptionTableTwo.setColumns(15);
jPanel11.add(jExceptionTableTwo);

jPanel3.add(jPanel11);

jPanel1.add(jPanel3);


jPanel4.setLayout(new java.awt.GridLayout(4, 1));

jPanel12.setLayout(new java.awt.GridLayout(1, 2));

jLabel14.setText("Exception Field");
jPanel12.add(jLabel14);


jExceptionFieldTwo.setColumns(15);
jPanel12.add(jExceptionFieldTwo);

jPanel4.add(jPanel12);


jPanel13.setLayout(new java.awt.GridLayout(1, 2));

jLabel15.setText("Exception Table");
jPanel13.add(jLabel15);


jExceptionTableThree.setColumns(15);
jPanel13.add(jExceptionTableThree);

jPanel4.add(jPanel13);


jPanel14.setLayout(new java.awt.GridLayout(1, 2));

jLabel16.setText("Exception Field");
jPanel14.add(jLabel16);


jExceptionFieldThree.setColumns(15);
jPanel14.add(jExceptionFieldThree);

jPanel4.add(jPanel14);

jPanel1.add(jPanel4);


getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);


jPanel31.setLayout(new java.awt.BorderLayout());

jPanel32.setLayout(new java.awt.GridLayout(1, 3));

jOkButton.setLabel("OK");
jOkButton.setActionCommand("ActionListener");
jOkButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jOkButton_actionPerfomed(evt);
}
}
);
jPanel32.add(jOkButton);


jCreateXML.setLabel("Clear");
jCreateXML.setText("Create XML");
jCreateXML.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCreateXML_actionPerformed(evt);
}
}
);
jPanel32.add(jCreateXML);


jExitButton.setLabel("Exit");
jExitButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jExitButton_actionPerformed(evt);
}
}
);
jPanel32.add(jExitButton);

jPanel31.add(jPanel32, java.awt.BorderLayout.CENTER);


getContentPane().add(jPanel31, java.awt.BorderLayout.SOUTH);

}
private void jCreateXML_actionPerformed(java.awt.event.ActionEvent evt) {
String actionCommand = evt.getActionCommand();
if(actionCommand.equals("Clear"))
{
jSeqName.setText("");
jSeqTable.setText("");
jSeqField.setText("");
jExceptionTableOne.setText("");
jExceptionFieldOne.setText("");
jExceptionTableTwo.setText("");
jExceptionFieldTwo.setText("");
jExceptionTableThree.setText("");
jExceptionFieldThree.setText("");
}
}
private void jOkButton_actionPerfomed(java.awt.event.ActionEvent evt) {
String sequenceName = jSeqName.getText();
String sequenceTable = jSeqTable.getText();
String sequenceField = jSeqField.getText();
String exceptionTableOne = jExceptionTableOne.getText();
String exceptionFieldOne = jExceptionFieldOne.getText();
String exceptionTableTwo = jExceptionTableTwo.getText();
String exceptionFieldTwo = jExceptionFieldTwo.getText();
String exceptionTableThree = jExceptionTableThree.getText();
String exceptionFieldThree = jExceptionFieldThree.getText();
if((sequenceName != null) && (sequenceTable != null) && (sequenceField != null) && (exceptionTableOne != null) && (exceptionFieldOne != null))
{
boolean notFound = true;
Enumeration e = myExceptionsHash.keys();
while(e.hasMoreElements())
{
String seqName = (String)e.nextElement();
mySequenceNames.add(seqName);
}
for(int count = 0; count < mySequenceNames.size(); count++)
{
String seqName = (String)mySequenceNames.get(count);
if(sequenceName.equalsIgnoreCase(seqName))
{
notFound = false;
Vector temp = (Vector)myExceptionsHash.get(seqName);
GenSequencesGui.PropertyEntry entry = new GenSequencesGui.PropertyEntry(exceptionTableOne, exceptionFieldOne);
temp.add(entry);
}
}
if(notFound)
{
GenSequencesGui.PropertyEntry entry = new GenSequencesGui.PropertyEntry(exceptionTableOne, exceptionFieldOne);
Vector temp = new Vector();
temp.add(entry);
myExceptionsHash.put(sequenceName, temp);
}
}
else
{
String errorText = "Sequence Name without a Sequence Table or Sequence Field.";
ErrorDialog one = new ErrorDialog(new GenSequencesGui(), errorText, true);
}

if((exceptionTableTwo != null) | | (exceptionFieldTwo != null))
{
Vector temp = (Vector)myExceptionsHash.get(sequenceName);
GenSequencesGui.PropertyEntry entry = new GenSequencesGui.PropertyEntry(exceptionTableTwo, exceptionFieldTwo);
temp.add(entry);
}
if((exceptionTableThree != null) | | (exceptionFieldThree != null))
{
Vector temp = (Vector)myExceptionsHash.get(sequenceName);
GenSequencesGui.PropertyEntry entry = new GenSequencesGui.PropertyEntry(exceptionTableThree, exceptionFieldThree);
temp.add(entry);
}

}
private void jExitButton_actionPerformed(java.awt.event.ActionEvent evt) {
this.setVisible(false);
}
private void jSequenceNameActionPerformed(java.awt.event.ActionEvent evt) {
// Add your handling code here:
}
/** Closes the dialog */
private void closeDialog(java.awt.event.WindowEvent evt) {
this.setVisible(false);
dispose ();
}
/**
* @param args the command line arguments
*/
public static void main (String args[]) {
new NewExceptions (new javax.swing.JFrame (), true, null).show ();
}

// Variables declaration - do not modify
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JLabel jLabel6;
private javax.swing.JPanel jPanel5;
private javax.swing.JLabel jLabel7;
private javax.swing.JTextField jSeqName;
private javax.swing.JPanel jPanel6;
private javax.swing.JLabel jLabel8;
private javax.swing.JTextField jSeqTable;
private javax.swing.JPanel jPanel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JTextField jSeqField;
private javax.swing.JPanel jPanel3;
private javax.swing.JLabel jLabel10;
private javax.swing.JPanel jPanel9;
private javax.swing.JLabel jLabel11;
private javax.swing.JTextField jExceptionTableOne;
private javax.swing.JPanel jPanel10;
private javax.swing.JLabel jLabel12;
private javax.swing.JTextField jExceptionFieldOne;
private javax.swing.JPanel jPanel11;
private javax.swing.JLabel jLabel13;
private javax.swing.JTextField jExceptionTableTwo;
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel12;
private javax.swing.JLabel jLabel14;
private javax.swing.JTextField jExceptionFieldTwo;
private javax.swing.JPanel jPanel13;
private javax.swing.JLabel jLabel15;
private javax.swing.JTextField jExceptionTableThree;
private javax.swing.JPanel jPanel14;
private javax.swing.JLabel jLabel16;
private javax.swing.JTextField jExceptionFieldThree;
private javax.swing.JPanel jPanel31;
private javax.swing.JPanel jPanel32;
private javax.swing.JButton jOkButton;
private javax.swing.JButton jCreateXML;
private javax.swing.JButton jExitButton;
// End of variables declaration
Hashtable myExceptionsHash = new Hashtable();
Vector mySequenceNames = new Vector();
}
 
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Compiled for me after commenting all references to GenSequencesGui. How about giving the line number that the compiler gave to you.
 
wasif akbar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Paul Stevens:
Compiled for me after commenting all references to GenSequencesGui. How about giving the line number that the compiler gave to you.


Paul,
Thanks for your quick response, I do appreciate it. Unfortunatelyrocco_46902@yahoo.com, Forte did not report the line number. Below is the actual errors:
C:\forte4j\com\teoco\GenSequences\NewExceptions.java: Invalid use of "this" selector syntax
C:\forte4j\com\teoco\GenSequences\NewExceptions.java: Invalid use of "this" selector syntax
C:\forte4j\com\teoco\GenSequences\NewExceptions.java: Invalid use of "this" selector syntax
C:\forte4j\com\teoco\GenSequences\NewExceptions.java: Invalid use of "this" selector syntax
Note: C:\forte4j\com\teoco\GenSequences\NewExceptions.java uses a deprecated API. Recompile with "-deprecation" for details.
4 errors
So here are a couple of the associated files. Maybe they will help in diagnosing the problem. Thanks again.
package com.teoco.GenSequences;
import java.io.File;
import java.awt.*;
import java.awt.TextField;
import java.awt.event.*;
import javax.swing.*;
import java.io.FileFilter;
import java.sql.*;
import java.util.Enumeration;
import com.teoco.GenSequences.*;
import com.teoco.Utilities.XmlInterface;
import java.util.Vector;
import java.util.Hashtable;
import org.xml.sax.AttributeList;

public class GenSequencesGui extends Frame implements ActionListener {
public GenSequencesGui()
{
//setIconImage(Toolkit.getDefaultToolkit().getImage("images/eplogo.gif"));
setTitle("GenSequences");
setLayout(new BorderLayout(0, 25));
setSize(500, 375);
setBackground(Color.lightGray);
addWindowListener(new WindowDestroyer());

Label northLabel = new Label();
add("North", northLabel);
Label eastLabel = new Label();
add("East", eastLabel);
Label westLabel = new Label();
add("West", westLabel);

Panel centerPanel = new Panel(new GridLayout(7, 2, 10, 10));
add("Center", centerPanel);
Label dbInstance = new Label("Database Instance");
centerPanel.add(dbInstance);
instance = new TextField();
centerPanel.add(instance);
Label dbHost = new Label("Database Host");
centerPanel.add(dbHost);
host = new TextField();
centerPanel.add(host);
Label dbPort = new Label("Port Number");
centerPanel.add(dbPort);
port = new TextField("1521");
centerPanel.add(port);
Label dbUsername = new Label("Username");
centerPanel.add(dbUsername);
username = new TextField();
centerPanel.add(username);
Label dbPassword = new Label("Password");
centerPanel.add(dbPassword);
password = new TextField();
centerPanel.add(password);
password.setEchoChar('*');
Label dbConfirmPassword = new Label("Confirm Password");
centerPanel.add(dbConfirmPassword);
confirmPassword = new TextField();
centerPanel.add(confirmPassword);
confirmPassword.setEchoChar('*');

Panel southPanel = new Panel(new BorderLayout());
add("South", southPanel);
TextField sField = new TextField();// This is the status bar field.
sField.setEditable(false);
southPanel.add("South", sField);
Label eLabel = new Label();
southPanel.add("East", eLabel);
Label wLabel = new Label();
southPanel.add("West", wLabel);

Panel sPanel = new Panel(new BorderLayout());
southPanel.add("North", sPanel);
Label sPanelELabel = new Label();
sPanel.add("East", sPanelELabel);
Label sPanelWLabel = new Label();
sPanel.add("West", sPanelWLabel);
Panel lastPanel = new Panel(new GridLayout(1, 3, 30, 0));
sPanel.add("Center", lastPanel);
Button genSeq = new Button("Generate Sequences");
lastPanel.add(genSeq);
genSeq.addActionListener(this);
Button testDBConn = new Button("Test Connection");
lastPanel.add(testDBConn);
testDBConn.addActionListener(this);
Button clearFields = new Button("Clear Fields");
lastPanel.add(clearFields);
clearFields.addActionListener(this);


Menu fileMenu = new Menu("File");
MenuItem gs = new MenuItem("Generate Sequences");
gs.addActionListener(this);
fileMenu.add(gs);
MenuItem tc = new MenuItem("Test Connection");
tc.addActionListener(this);
fileMenu.add(tc);
MenuItem cf = new MenuItem("Clear Fields");
cf.addActionListener(this);
fileMenu.add(cf);
MenuItem cs = new MenuItem("Check Sequences");
cs.addActionListener(this);
fileMenu.add(cs);
MenuItem exit = new MenuItem("Exit");
exit.addActionListener(this);
fileMenu.add(exit);

Menu viewMenu = new Menu("View");
MenuItem vl = new MenuItem("View Log");
vl.addActionListener(this);
viewMenu.add(vl);
MenuItem r = new MenuItem("Refresh");
r.addActionListener(this);
viewMenu.add(r);
MenuItem ed = new MenuItem("Exceptions Editor");
ed.addActionListener(this);
viewMenu.add(ed);

MenuBar mBar = new MenuBar();
mBar.add(fileMenu);
mBar.add(viewMenu);
setMenuBar(mBar);
}

public class PropertyEntry
{
PropertyEntry(String tblName, String tblField)
{
myExceptionTableName = tblName;
myExceptionTableField = tblField;
}
String getExceptionTableName()
{return myExceptionTableName;}

String getExceptionTableField()
{return myExceptionTableField;}
private String myExceptionTableName;
private String myExceptionTableField;
}


public void load()
{
XmlInterface xml = new XmlInterface();
try
{
xml.getAttributes(myExceptionsFile, new XmlHandler()); // Getting attributes of exceptions xml file.
}
catch(Exception ex)
{
String errorText = "Error parsing the exceptions file";
ErrorDialog fileCreateDialog = new ErrorDialog(new GenSequencesGui(), errorText, true);
}
}


private class XmlHandler implements XmlInterface.XmlAttributeHandler
{
// This method is called for every element name.
public void startElement(String name, AttributeList attrs)
{
Vector properties;
Vector temp;
if (name.equalsIgnoreCase("SEQUENCE"))
{
properties = new Vector();
seqName = attrs.getValue("name");
myExceptionsHash.put(seqName, properties);
}
if (name.equalsIgnoreCase("TABLE"))
{
temp = (Vector)myExceptionsHash.get(seqName);
PropertyEntry entry = new PropertyEntry(attrs.getValue("tbl_name"), attrs.getValue("fld_name"));
temp.add(entry);
}
}
}
public static void main(String[] args)
{
GenSequencesGui myGui = new GenSequencesGui();
myGui.setVisible(true);
}

public void actionPerformed(ActionEvent e)
{
String actionCommand = e.getActionCommand();
if(actionCommand.equals("Exceptions Editor"))
{
load();
ExceptionDialog ed = new ExceptionDialog(this, myExceptionsHash);
ed.setVisible(true);
}

if(actionCommand.equals("Exit"))
{
this.setVisible(false);
}

if(actionCommand.equals("Test Connection"))// Create a connection to the database. Show confirmation pop up.
{
String inst = instance.getText();
String h = host.getText();
int p = Integer.parseInt(port.getText());
String uname = username.getText();
String pwd = password.getText();
String conpwd = confirmPassword.getText();
DBConnect testConn = new DBConnect(h, p, inst, uname, pwd, conpwd);
testConn.testConnection();
}

if(actionCommand.equals("Generate Sequences"))
{
String inst = instance.getText();
String h = host.getText();
int p = Integer.parseInt(port.getText());
String uname = username.getText();
String pwd = password.getText();
String conpwd = confirmPassword.getText();
GenerateSequences genSeq = new GenerateSequences(h, p, inst, uname, pwd, conpwd);
}
if(actionCommand.equals("Clear Fields"))
{
instance.setText("");
host.setText("");
port.setText("");
username.setText("");
password.setText("");
confirmPassword.setText("");
}
}

public TextField instance;
public TextField host;
public TextField port;
public TextField username;
public TextField password;
public TextField confirmPassword;
public Hashtable myExceptionsHash = new Hashtable();
public String seqName;
public File myExceptionsFile = new File("com\\teoco\\GenSequences\\Exceptions.xml");
public Vector mySequenceNames = new Vector();

}
package com.teoco.GenSequences;
import java.awt.*;
import javax.swing.*;
import java.util.Vector;
import javax.swing.table.DefaultTableModel;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionListener;
import javax.swing.event.ListSelectionEvent;
import java.util.Hashtable;
import java.util.Enumeration;
public class ExceptionDialog extends javax.swing.JDialog
{
public ExceptionDialog(Frame parent, Hashtable exceptions)
{
super(parent);
myExceptionsHash = exceptions;
getContentPane().setLayout(new GridLayout(1,1,0,0));
setSize(405,305);
setVisible(false);
JPanel1.setLayout(new GridLayout(3,1,0,0));
getContentPane().add(JPanel1);
JPanel2.setLayout(new GridLayout(1,1,0,0));
JPanel1.add(JPanel2);
JPanel2.add(JScrollPane1);

JSequenceNamesTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
JSequenceNamesTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
if (ALLOW_ROW_SELECTION) // true by default
{
ListSelectionModel rowSM = JSequenceNamesTable.getSelectionModel();
rowSM.addListSelectionListener(new ListSelectionListener()
{
public void valueChanged(ListSelectionEvent e) {
//Ignore extra messages.
if (e.getValueIsAdjusting()) return;
ListSelectionModel lsm = (ListSelectionModel)e.getSource();
if (lsm.isSelectionEmpty())
{
System.out.println("No rows are selected.");
}
else
{
SequenceExceptionsModel = null;
SequenceExceptionsModel = new DefaultTableModel();
SequenceExceptionsModel.setDataVector(new Vector(), myColumnNames);
int selectedRow = lsm.getMinSelectionIndex();
String temp = (String)mySequenceNames.get(selectedRow);
Vector values = (Vector)myExceptionsHash.get(temp);
for(int count = 0; count < values.size(); count++)
{
GenSequencesGui.PropertyEntry tempEntry = (GenSequencesGui.PropertyEntry)values.get(count);
String tableName = tempEntry.getExceptionTableName();
String fieldName = tempEntry.getExceptionTableField();
Vector row = new Vector();
row.add(tableName);
row.add(fieldName);
SequenceExceptionsModel.addRow(row);
}
JSequenceExceptionsTable.setModel(SequenceExceptionsModel);
int rowCount = SequenceExceptionsModel.getRowCount();
}
}
});
}
else
{
JSequenceNamesTable.setRowSelectionAllowed(false);
}

JScrollPane1.getViewport().add(JSequenceNamesTable);
JSequenceNamesTable.setBounds(0,0,228,34);
JPanel3.setLayout(new GridLayout(1,1,0,0));
JPanel1.add(JPanel3);
JPanel3.add(JScrollPane2);
JSequenceExceptionsTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
JScrollPane2.getViewport().add(JSequenceExceptionsTable);
JSequenceExceptionsTable.setBounds(0,0,152,34);
SequenceNamesModel = new DefaultTableModel();
SequenceExceptionsModel = new DefaultTableModel();
JSequenceNamesTable.setModel(SequenceNamesModel);
JSequenceExceptionsTable.setModel(SequenceExceptionsModel);
JPanel4.setLayout(new GridLayout(3,1,0,0));
JPanel1.add(JPanel4);
JPanel4.add(JPanel6);
JPanel4.add(JPanel7);
JPanel4.add(JPanel8);
JPanel7.setLayout(new GridLayout(1,3,50,50));
JPanel7.add(JAddButton);
JAddButton.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
JAddButton_actionPerformed(evt);
}
}
);
JPanel7.add(JEditButton);
JEditButton.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
JEditButton_actionPerformed(evt);
}
}
);
JPanel7.add(JExitButton);
JExitButton.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
JExitButton_actionPerformed(evt);
}
}
);
addItems();
}
private void addItems()
{
Enumeration enum = myExceptionsHash.keys();
while(enum.hasMoreElements())
{
String seqName = (String)enum.nextElement();
mySequenceNames.add(seqName);
}
Vector data = new Vector();
for(int count = 0; count < mySequenceNames.size(); count++)
{
Vector temp = new Vector();
String seqName = (String)mySequenceNames.get(count);
temp.add(seqName);
data.add(temp);
}
Vector columnNames = new Vector();
columnNames.add("SEQUENCE NAME");
SequenceNamesModel.setDataVector(data, columnNames);
Vector tempTwo = new Vector();
myColumnNames = new Vector();
myColumnNames.add("EXCEPTIONS TABLE");
myColumnNames.add("EXCEPTIONN FIELD");
SequenceExceptionsModel.setDataVector(tempTwo, myColumnNames);
}

private void JExitButton_actionPerformed(java.awt.event.ActionEvent evt)
{
this.setVisible(false);
}

private void JEditButton_actionPerformed(java.awt.event.ActionEvent evt)
{
this.setVisible(false);
}

private void JAddButton_actionPerformed(java.awt.event.ActionEvent evt)
{
NewExceptions ne = new NewExceptions(new GenSequencesGui(), true, myExceptionsHash);
ne.setVisible(true);
}
public ExceptionDialog()
{
this((Frame)null, null);
}
public ExceptionDialog(String sTitle)
{
this();
setTitle(sTitle);
}
public void setVisible(boolean b)
{
if (b)
setLocation(50, 50);
super.setVisible(b);
}
static public void main(String args[])
{
try
{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch(Exception ex)
{
}
(new ExceptionDialog()).setVisible(true);
}
JPanel JPanel1 = new JPanel();
JPanel JPanel2 = new JPanel();
JScrollPane JScrollPane1 = new JScrollPane();
JTable JSequenceNamesTable = new JTable();
JPanel JPanel3 = new JPanel();
JPanel JPanel4 = new JPanel();
JButton JAddButton = new JButton("Add");
JButton JEditButton = new JButton("Edit");
JButton JExitButton = new JButton("Exit");
JScrollPane JScrollPane2 = new JScrollPane();
JTable JSequenceExceptionsTable = new JTable();
JPanel JPanel6 = new JPanel();
JPanel JPanel7 = new JPanel();
JPanel JPanel8 = new JPanel();
private DefaultTableModel SequenceNamesModel;
private DefaultTableModel SequenceExceptionsModel;
private boolean ALLOW_ROW_SELECTION = true;
private Vector mySequenceNames = new Vector();
private Hashtable myExceptionsHash = new Hashtable();
private Vector myColumnNames;
}

 
reply
    Bookmark Topic Watch Topic
  • New Topic