NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

import javax.swing.*;
import javax.swing.text.html.parser.ParserDelegator;
public class RoutineMaintainance extends JFrame implements ItemListener{
private final double oil_change= 26.00;
private final double lube_job= 18.00;
private final double radiator_flush= 30.00;
private final double transmission_flush= 80.00;
private final double inspection= 15.00;
private final double muffler_replacement= 100.00;
private final double tire_rotation= 20.00;
private JCheckBox oilChange, lubeJob, radiatorFlush, transmissionFlush, Inspection, mufflerReplacement, tirRotation;
private JTextField tf_total;
private double total=0.0;
public RoutineMaintainance() {
setSize(600,500);
setLocationRelativeTo(null);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setResizable(false);

JPanel pnl= new JPanel();
pnl.setBounds(20, 20 , 500, 400);
pnl.setLayout(null);
getContentPane().add(pnl);

oilChange= new JCheckBox("Oil change");
oilChange.setBounds(20, 20, 150, 30 );
oilChange.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if(e.getStateChange()==1) {
total+=oil_change;
}
}
});
pnl.add(oilChange);

lubeJob= new JCheckBox("Lube Job");
lubeJob.setBounds(20, 65, 150, 30 );
lubeJob.addItemListener(new ItemListener() {

@Override
public void itemStateChanged(ItemEvent e) {
if(e.getStateChange()==1) {
total+=lube_job;
}
}
});
pnl.add(lubeJob);

radiatorFlush= new JCheckBox("Radiator Flush");
radiatorFlush.setBounds(20, 110, 150, 30 );
radiatorFlush.addItemListener(new ItemListener() {

@Override
public void itemStateChanged(ItemEvent e) {
if(e.getStateChange()==1) {
total+=radiator_flush;
}
}
});
pnl.add(radiatorFlush);

transmissionFlush= new JCheckBox("Transmission Flush");
transmissionFlush.setBounds(20, 155, 150, 30 );
transmissionFlush.addItemListener(new ItemListener() {

@Override
public void itemStateChanged(ItemEvent e) {
if(e.getStateChange()==1) {
total+=transmission_flush;
}
}
});
pnl.add(transmissionFlush);

Inspection= new JCheckBox("Inspection");
Inspection.setBounds(20, 200, 150, 30 );
Inspection.addItemListener(new ItemListener() {

@Override
public void itemStateChanged(ItemEvent e) {
if(e.getStateChange()==1) {
total+=inspection;
}
}
});
pnl.add(Inspection);

mufflerReplacement= new JCheckBox("mMffler Replacement");
mufflerReplacement.setBounds(20, 245, 150, 30 );
mufflerReplacement.addItemListener(new ItemListener() {

@Override
public void itemStateChanged(ItemEvent e) {
if(e.getStateChange()==1) {
total+=muffler_replacement;
}
}
});
pnl.add(mufflerReplacement);

tirRotation= new JCheckBox("Tire rotation");
tirRotation.setBounds(20, 290, 150, 30 );
tirRotation.addItemListener(new ItemListener() {

@Override
public void itemStateChanged(ItemEvent e) {
if(e.getStateChange()==1) {
total+=tire_rotation;
}
}
});
pnl.add(tirRotation);


JButton Btntotal= new JButton("Total: ");
Btntotal.setBounds(20, 335, 150, 30);
Btntotal.addActionListener(new ActionListener() {

@Override
public void actionPerformed(ActionEvent e) {
tf_total.setText( Double.toString(total));
}
});
pnl.add(Btntotal);

JLabel lbl_total= new JLabel("Total");
lbl_total.setBounds(20, 380, 150, 30);
pnl.add(lbl_total);

tf_total= new JTextField(40);
tf_total.setBounds(150, 380, 150, 30);
pnl.add(tf_total);

setVisible(true);

}



public static void main(String[] args) {
new RoutineMaintainance();
}

@Override
public void itemStateChanged(ItemEvent e) {
// TODO Auto-generated method stub

}
}

     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.