help with java buttons and applets? I'm desperate


S

StillillWill

OK so I'm asking for some help here and looked through the topics and
nothing was close to this question so if anyone could help it would be
greatly appreciated... thanks...

I'm trying to make an Graphical User Interface in java for a java
program and I'm using an applet...right...right

So there are different "windows" in this user interface. Three to be
exact and I want to have buttons that would link to each window...

So I made the buttons...

So I made a mouse clicked method so that when you clicked the button
something would happen and wasn't sure what to do after that...

Heres my code any help would be great...

public class JApplet_4 extends javax.swing.JApplet {

/** Creates new form JApplet_4 */
public JApplet_4() {
initComponents();

}

/** 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 Form Editor.
*/
private void initComponents() {
jTextArea1 = new javax.swing.JTextArea();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jTextField2 = new javax.swing.JTextField();
jTextField3 = new javax.swing.JTextField();
jTextField4 = new javax.swing.JTextField();
jTextField5 = new javax.swing.JTextField();
jTextField6 = new javax.swing.JTextField();
jTextField7 = new javax.swing.JTextField();
jTextField8 = new javax.swing.JTextField();
jTextField9 = new javax.swing.JTextField();
jTextField10 = new javax.swing.JTextField();
jTextField11 = new javax.swing.JTextField();
jTextField12 = new javax.swing.JTextField();
jTextField13 = new javax.swing.JTextField();
jTextField14 = new javax.swing.JTextField();
jTextField15 = new javax.swing.JTextField();
jTextField16 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jButton5 = new javax.swing.JButton();
jButton6 = new javax.swing.JButton();
jButton7 = new javax.swing.JButton();
jButton8 = new javax.swing.JButton();

getContentPane().setLayout(null);

setName("Vehicle");
jTextArea1.setBackground(java.awt.Color.lightGray);
jTextArea1.setText("Vehicle");
getContentPane().add(jTextArea1);
jTextArea1.setBounds(140, 10, 40, 20);

jLabel1.setText("Registration Number:");
getContentPane().add(jLabel1);
jLabel1.setBounds(10, 40, 120, 20);

jLabel2.setText("Make:");
getContentPane().add(jLabel2);
jLabel2.setBounds(10, 60, 34, 20);

jLabel3.setText("Model:");
getContentPane().add(jLabel3);
jLabel3.setBounds(10, 80, 37, 20);

jLabel4.setText("Price Band:");
getContentPane().add(jLabel4);
jLabel4.setBounds(10, 100, 65, 20);

jLabel5.setText("Colour:");
getContentPane().add(jLabel5);
jLabel5.setBounds(10, 120, 40, 20);

jLabel6.setText("Engine Size:");
getContentPane().add(jLabel6);
jLabel6.setBounds(10, 140, 68, 20);

jLabel7.setText("CD Player:");
getContentPane().add(jLabel7);
jLabel7.setBounds(10, 160, 58, 20);

jLabel8.setText("Availability:");
getContentPane().add(jLabel8);
jLabel8.setBounds(10, 180, 63, 20);

jLabel9.setText("Transmission:");
getContentPane().add(jLabel9);
jLabel9.setBounds(10, 200, 81, 20);

jLabel10.setText("Date Taken:");
getContentPane().add(jLabel10);
jLabel10.setBounds(10, 220, 67, 20);

jLabel11.setText("Date Due:");
getContentPane().add(jLabel11);
jLabel11.setBounds(10, 240, 54, 20);

jLabel12.setText("Charges:");
getContentPane().add(jLabel12);
jLabel12.setBounds(10, 260, 51, 20);

jTextField1.setText("Registration Number");
getContentPane().add(jTextField1);
jTextField1.setBounds(140, 40, 119, 20);

jTextField2.setText("Make");
getContentPane().add(jTextField2);
jTextField2.setBounds(140, 60, 33, 20);

jTextField3.setText("Model");
jTextField3.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jTextField3ActionPerformed(evt);
}
});

getContentPane().add(jTextField3);
jTextField3.setBounds(140, 80, 37, 20);

jTextField4.setText("Price Band");
jTextField4.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jTextField4ActionPerformed(evt);
}
});

getContentPane().add(jTextField4);
jTextField4.setBounds(140, 100, 64, 20);

jTextField5.setText("Colour");
jTextField5.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jTextField5ActionPerformed(evt);
}
});

getContentPane().add(jTextField5);
jTextField5.setBounds(140, 120, 41, 20);

jTextField6.setText("Engine Size");
jTextField6.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jTextField6ActionPerformed(evt);
}
});

getContentPane().add(jTextField6);
jTextField6.setBounds(140, 140, 69, 20);

jTextField7.setText("CD Player");
jTextField7.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jTextField7ActionPerformed(evt);
}
});

getContentPane().add(jTextField7);
jTextField7.setBounds(140, 160, 59, 20);

jTextField8.setText("Availability");
jTextField8.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jTextField8ActionPerformed(evt);
}
});

getContentPane().add(jTextField8);
jTextField8.setBounds(140, 180, 60, 20);

jTextField9.setText("Transmission");
jTextField9.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jTextField9ActionPerformed(evt);
}
});

getContentPane().add(jTextField9);
jTextField9.setBounds(140, 200, 81, 20);

jTextField10.setText("DD");
getContentPane().add(jTextField10);
jTextField10.setBounds(140, 220, 22, 20);

jTextField11.setText("MM");
jTextField11.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jTextField11ActionPerformed(evt);
}
});

getContentPane().add(jTextField11);
jTextField11.setBounds(170, 220, 22, 20);

jTextField12.setText("YY");
jTextField12.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jTextField12ActionPerformed(evt);
}
});

getContentPane().add(jTextField12);
jTextField12.setBounds(200, 220, 18, 20);

jTextField13.setText("DD");
getContentPane().add(jTextField13);
jTextField13.setBounds(140, 240, 22, 20);

jTextField14.setText("MM");
jTextField14.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jTextField14ActionPerformed(evt);
}
});

getContentPane().add(jTextField14);
jTextField14.setBounds(170, 240, 22, 20);

jTextField15.setText("YY");
getContentPane().add(jTextField15);
jTextField15.setBounds(200, 240, 18, 20);

jTextField16.setText("Charges");
jTextField16.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jTextField16ActionPerformed(evt);
}
});

getContentPane().add(jTextField16);
jTextField16.setBounds(140, 260, 52, 20);

jButton1.setText("Add");
getContentPane().add(jButton1);
jButton1.setBounds(10, 290, 56, 26);

jButton2.setText("Remove");
jButton2.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jButton2ActionPerformed(evt);
}
});

getContentPane().add(jButton2);
jButton2.setBounds(70, 290, 80, 26);

jButton3.setText("Update");
jButton3.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jButton3ActionPerformed(evt);
}
});

getContentPane().add(jButton3);
jButton3.setBounds(160, 290, 74, 26);

jButton4.setText("Save");
jButton4.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jButton4ActionPerformed(evt);
}
});

getContentPane().add(jButton4);
jButton4.setBounds(240, 290, 62, 26);

jButton5.setText("Main");
jButton5.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jButton5ActionPerformed(evt);
}
});

getContentPane().add(jButton5);
jButton5.setBounds(10, 320, 61, 26);

jButton6.setText("Rental");
jButton6.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jButton6ActionPerformed(evt);
}
});

getContentPane().add(jButton6);
jButton6.setBounds(80, 320, 70, 26);

jButton7.setText("Customer");
jButton7.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jButton7ActionPerformed(evt);
}
});

getContentPane().add(jButton7);
jButton7.setBounds(160, 320, 90, 26);

jButton8.setText("Close");
jButton8.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jButton8ActionPerformed(evt);
}
});

jButton8.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton8MouseClicked(evt);
}
});

getContentPane().add(jButton8);
jButton8.setBounds(260, 320, 66, 26);

}

private void jButton8MouseClicked(java.awt.event.MouseEvent evt) {
// Add your handling code here:


}

private void jButton8ActionPerformed(java.awt.event.ActionEvent
evt) {
// Add your handling code here:
}


private void jButton7MouseClicked(java.awt.event.MouseEvent evt) {
// Add your handling code here:


}

private void jButton7ActionPerformed(java.awt.event.ActionEvent
evt) {
// Add your handling code here:

}

private void jButton6ActionPerformed(java.awt.event.ActionEvent
evt) {
// Add your handling code here:
}

private void jButton5ActionPerformed(java.awt.event.ActionEvent
evt) {
// Add your handling code here:
}

private void jButton4ActionPerformed(java.awt.event.ActionEvent
evt) {
// Add your handling code here:
}

private void jButton3ActionPerformed(java.awt.event.ActionEvent
evt) {
// Add your handling code here:
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent
evt) {
// Add your handling code here:
}

private void jTextField16ActionPerformed(java.awt.event.ActionEvent
evt) {
// Add your handling code here:
}

private void jTextField9ActionPerformed(java.awt.event.ActionEvent
evt) {
// Add your handling code here:
}

private void jTextField8ActionPerformed(java.awt.event.ActionEvent
evt) {
// Add your handling code here:
}

private void jTextField7ActionPerformed(java.awt.event.ActionEvent
evt) {
// Add your handling code here:
}

private void jTextField6ActionPerformed(java.awt.event.ActionEvent
evt) {
// Add your handling code here:
}

private void jTextField5ActionPerformed(java.awt.event.ActionEvent
evt) {
// Add your handling code here:
}

private void jTextField4ActionPerformed(java.awt.event.ActionEvent
evt) {
// Add your handling code here:
}

private void jTextField3ActionPerformed(java.awt.event.ActionEvent
evt) {
// Add your handling code here:
}

private void jTextField14ActionPerformed(java.awt.event.ActionEvent
evt) {
// Add your handling code here:
}

private void jTextField12ActionPerformed(java.awt.event.ActionEvent
evt) {
// Add your handling code here:
}

private void jTextField11ActionPerformed(java.awt.event.ActionEvent
evt) {
// Add your handling code here:
}


// Variables declaration - do not modify
private javax.swing.JTextArea jTextArea1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
private javax.swing.JTextField jTextField4;
private javax.swing.JTextField jTextField5;
private javax.swing.JTextField jTextField6;
private javax.swing.JTextField jTextField7;
private javax.swing.JTextField jTextField8;
private javax.swing.JTextField jTextField9;
private javax.swing.JTextField jTextField10;
private javax.swing.JTextField jTextField11;
private javax.swing.JTextField jTextField12;
private javax.swing.JTextField jTextField13;
private javax.swing.JTextField jTextField14;
private javax.swing.JTextField jTextField15;
private javax.swing.JTextField jTextField16;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JButton jButton6;
private javax.swing.JButton jButton7;
private javax.swing.JButton jButton8;
// End of variables declaration

}




So I want it to make another applet window open that is a given file
name, how do I do that?

On a separate note I couldn't make the applet open to the size I wanted
because I couldn't find out where to put the set width and set height
variables...

really any help would be great
 
Ad

Advertisements

T

Tom Hawtin

jLabel1 = new javax.swing.JLabel();

Is this all some kind of object code?

It's much easier to write something like:

panel.add(new JLabel("Registration Number:", cons));

Use a layout manager, rather than absolute positioning. There is no
knowing what size a particular environment will make the label. It also
helps with internationalisation, and just not having to worry about
calculating alignments yourself.
So I want it to make another applet window open that is a given file
name, how do I do that?

Another applet in the same context? Just add another applet (or object)
tag to your HTML. You can use AppletContext to get hold of the other
applets in the page.
On a separate note I couldn't make the applet open to the size I wanted
because I couldn't find out where to put the set width and set height
variables...

It's defined by the mandatory width and height attributes of the applet
tag (I guess it's resizeable with JavaScript or the obscure DOM API).

Tom Hawtin
 
S

StillillWill

Thanks Tom,

I can't use HTML that's the problem otherwise i'd specify the size
there. It is a GUI window and I have another GUI window made in the
same way and I wanted one button to go to one applet and one to go to
another is that possible given this code?
 
T

Tom Hawtin

I can't use HTML that's the problem otherwise i'd specify the size
there. It is a GUI window and I have another GUI window made in the
same way and I wanted one button to go to one applet and one to go to
another is that possible given this code?

So you have an applet that opens windows (JFrames). Is that right?

First of all, I have to say that is going to get very confusing when the
browser is moved to the front and obscures the windows.

So what you need to do is create a JFrame. Add your buttons and what not
to it. Call pack() and the setVisible(true) on it.

The design of java.applet.Applet (and the designs in many beginner
books) lead you in a bad direction. It's much easier to avoid
inheritance as much as possible. There is no need to extend an applet,
frame or panel to add components to it.

Of course, you need to extend Applet/JApplet just to override init (and
possibly others). BTW: You should create your components in the init
method, which technically should use EventQueue.invokeAndWait. If you
try to open a window there, you should definitely use invokeAndWait, or
just invokeLater for the frame stuff.

Tom Hawtin
 
Ad

Advertisements

S

StillillWill

That's a lot of help thanks Tom I rewrote this:



public class GUIVehicle extends javax.swing.JFrame {


public GUIVehicle() {
initComponents();
}

/** 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 Form Editor.
*/
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jTextField2 = new javax.swing.JTextField();
jTextField3 = new javax.swing.JTextField();
jTextField4 = new javax.swing.JTextField();
jTextField5 = new javax.swing.JTextField();
jTextField6 = new javax.swing.JTextField();
jTextField7 = new javax.swing.JTextField();
jTextField8 = new javax.swing.JTextField();
jTextField9 = new javax.swing.JTextField();
jTextField10 = new javax.swing.JTextField();
jTextField11 = new javax.swing.JTextField();
jTextField12 = new javax.swing.JTextField();
jTextField13 = new javax.swing.JTextField();
jTextField14 = new javax.swing.JTextField();
jTextField15 = new javax.swing.JTextField();
jTextField16 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jButton5 = new javax.swing.JButton();
jButton6 = new javax.swing.JButton();
jButton7 = new javax.swing.JButton();
jButton8 = new javax.swing.JButton();
jList1 = new javax.swing.JList();
jLabel13 = new javax.swing.JLabel();

getContentPane().setLayout(null);

addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
exitForm(evt);
}
});

jLabel1.setText("Registration Number:");
getContentPane().add(jLabel1);
jLabel1.setBounds(20, 40, 120, 20);

jLabel2.setText("Make:");
getContentPane().add(jLabel2);
jLabel2.setBounds(20, 70, 34, 20);

jLabel3.setText("Model:");
getContentPane().add(jLabel3);
jLabel3.setBounds(20, 100, 37, 20);

jLabel4.setText("Price Band:");
getContentPane().add(jLabel4);
jLabel4.setBounds(20, 130, 65, 20);

jLabel5.setText("Colour:");
getContentPane().add(jLabel5);
jLabel5.setBounds(20, 160, 40, 20);

jLabel6.setText("Engine Size:");
getContentPane().add(jLabel6);
jLabel6.setBounds(20, 190, 68, 20);

jLabel7.setText("CD Player:");
getContentPane().add(jLabel7);
jLabel7.setBounds(20, 220, 58, 20);

jLabel8.setText("Availability:");
getContentPane().add(jLabel8);
jLabel8.setBounds(20, 250, 63, 20);

jLabel9.setText("Transmission:");
getContentPane().add(jLabel9);
jLabel9.setBounds(20, 280, 81, 20);

jLabel10.setText("Date Taken:");
getContentPane().add(jLabel10);
jLabel10.setBounds(20, 310, 67, 20);

jLabel11.setText("Date Due:");
getContentPane().add(jLabel11);
jLabel11.setBounds(20, 340, 54, 20);

jLabel12.setText("Charges:");
getContentPane().add(jLabel12);
jLabel12.setBounds(20, 370, 51, 20);

jTextField1.setText("Registration Number");
jTextField1.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jTextField1ActionPerformed(evt);
}
});

getContentPane().add(jTextField1);
jTextField1.setBounds(170, 40, 119, 20);

jTextField2.setText("Make");
jTextField2.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jTextField2ActionPerformed(evt);
}
});

getContentPane().add(jTextField2);
jTextField2.setBounds(170, 70, 33, 20);

jTextField3.setText("Model");
getContentPane().add(jTextField3);
jTextField3.setBounds(170, 100, 37, 20);

jTextField4.setText("Price Band");
getContentPane().add(jTextField4);
jTextField4.setBounds(170, 130, 64, 20);

jTextField5.setText("Colour");
getContentPane().add(jTextField5);
jTextField5.setBounds(170, 160, 41, 20);

jTextField6.setText("Engine Size");
getContentPane().add(jTextField6);
jTextField6.setBounds(170, 190, 69, 20);

jTextField7.setText("CD Player");
getContentPane().add(jTextField7);
jTextField7.setBounds(170, 220, 59, 20);

jTextField8.setText("Availability");
getContentPane().add(jTextField8);
jTextField8.setBounds(170, 250, 60, 20);

jTextField9.setText("Transmission");
getContentPane().add(jTextField9);
jTextField9.setBounds(170, 280, 81, 20);

jTextField10.setText("DD");
getContentPane().add(jTextField10);
jTextField10.setBounds(170, 310, 22, 20);

jTextField11.setText("MM");
getContentPane().add(jTextField11);
jTextField11.setBounds(200, 310, 22, 20);

jTextField12.setText("YY");
getContentPane().add(jTextField12);
jTextField12.setBounds(230, 310, 18, 20);

jTextField13.setText("DD");
jTextField13.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jTextField13ActionPerformed(evt);
}
});

getContentPane().add(jTextField13);
jTextField13.setBounds(170, 340, 22, 20);

jTextField14.setText("MM");
jTextField14.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jTextField14ActionPerformed(evt);
}
});

getContentPane().add(jTextField14);
jTextField14.setBounds(200, 340, 22, 20);

jTextField15.setText("YY");
jTextField15.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jTextField15ActionPerformed(evt);
}
});

getContentPane().add(jTextField15);
jTextField15.setBounds(230, 340, 18, 20);

jTextField16.setText("Charges");
getContentPane().add(jTextField16);
jTextField16.setBounds(170, 370, 52, 20);

jButton1.setText("Add");
jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton1MouseClicked(evt);
}
});

getContentPane().add(jButton1);
jButton1.setBounds(30, 410, 56, 26);

jButton2.setText("Remove");
jButton2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton2MouseClicked(evt);
}
});

getContentPane().add(jButton2);
jButton2.setBounds(90, 410, 80, 26);

jButton3.setText("Update");
jButton3.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton3MouseClicked(evt);
}
});

getContentPane().add(jButton3);
jButton3.setBounds(180, 410, 74, 26);

jButton4.setText("Save");
jButton4.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton4MouseClicked(evt);
}
});

getContentPane().add(jButton4);
jButton4.setBounds(40, 440, 62, 26);

jButton5.setText("Main");
jButton5.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton5MouseClicked(evt);
}
});

getContentPane().add(jButton5);
jButton5.setBounds(110, 440, 61, 26);

jButton6.setText("Rental");
jButton6.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton6MouseClicked(evt);
}
});

getContentPane().add(jButton6);
jButton6.setBounds(180, 440, 70, 26);

jButton7.setText("Customer");
jButton7.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton7MouseClicked(evt);
}
});

getContentPane().add(jButton7);
jButton7.setBounds(60, 470, 90, 26);

jButton8.setText("Close");
jButton8.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton8MouseClicked(evt);
}
});

getContentPane().add(jButton8);
jButton8.setBounds(160, 470, 66, 26);

getContentPane().add(jList1);
jList1.setBounds(80, 50, 0, 0);

jLabel13.setText("Vehicle:");
getContentPane().add(jLabel13);
jLabel13.setBounds(130, 10, 45, 20);

pack();
}

private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {
// Add your handling code here:add
}

private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {
// Add your handling code here:remove
}

private void jButton3MouseClicked(java.awt.event.MouseEvent evt) {
// Add your handling code here:update
}

private void jButton4MouseClicked(java.awt.event.MouseEvent evt) {
// Add your handling code here:save
}

private void jButton5MouseClicked(java.awt.event.MouseEvent evt) {
// Add your handling code here:main
}

private void jButton6MouseClicked(java.awt.event.MouseEvent evt) {
// Add your handling code here:rental
}

private void jButton7MouseClicked(java.awt.event.MouseEvent evt) {
// Add your handling code here:customer
}

private void jButton8MouseClicked(java.awt.event.MouseEvent evt) {
// Add your handling code here:close
System.exit(0);
}

private void jTextField15ActionPerformed(java.awt.event.ActionEvent
evt) {
// Add your handling code here:
}

private void jTextField14ActionPerformed(java.awt.event.ActionEvent
evt) {
// Add your handling code here:
}

private void jTextField13ActionPerformed(java.awt.event.ActionEvent
evt) {
// Add your handling code here:
}

private void jTextField2ActionPerformed(java.awt.event.ActionEvent
evt) {
// Add your handling code here:
}

private void jTextField1ActionPerformed(java.awt.event.ActionEvent
evt) {
// Add your handling code here:
}

/** Exit the Application */
private void exitForm(java.awt.event.WindowEvent evt) {
System.exit(0);
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
new GUIVehicle().show();
}


// Variables declaration - do not modify
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
private javax.swing.JTextField jTextField4;
private javax.swing.JTextField jTextField5;
private javax.swing.JTextField jTextField6;
private javax.swing.JTextField jTextField7;
private javax.swing.JTextField jTextField8;
private javax.swing.JTextField jTextField9;
private javax.swing.JTextField jTextField10;
private javax.swing.JTextField jTextField11;
private javax.swing.JTextField jTextField12;
private javax.swing.JTextField jTextField13;
private javax.swing.JTextField jTextField14;
private javax.swing.JTextField jTextField15;
private javax.swing.JTextField jTextField16;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JButton jButton6;
private javax.swing.JButton jButton7;
private javax.swing.JButton jButton8;
private javax.swing.JList jList1;
private javax.swing.JLabel jLabel13;
// End of variables declaration

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top