buggytoast 0 Newbie Poster

Sorry for double posting. I'm just going to give a more in depth thing explanation of what I said before.

1. My program works fine now. In Orderlist i originally wrote
public class OrderList extends Vector<TreeData>
However using vectors doesn't show me using mastery. I need to have the code for the vectors and just change the variables and such. What I did was I took the source code of vectors and created a new class called "LinkedList".

So I replaced extends Vector<TreeData> with extends LinkedList and it doesn't work anymore. I changed the variables around but still. no can do :(

I hope that cleared things up abit. Thanks for your time.

buggytoast 0 Newbie Poster

Hey guys! :D

My program implements the vector class however it only shows I know how to use the Vector Class, and not how to develop a code for a linked list :( My teacher says I can just do a copy paste job, which is precisely what I did. But for some strange reason it still doesn't work. Does anyone know whats wrong?

Here are the java classes that make the program run.

Here's the main

// Philip Kao
// IB Comsci Dossier
// TreeClassics Program
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;

public class TreeClassics extends JFrame
{
    //include aspects of GUI
    private JTextField quantityField, thicknessField, widthField,
            plysField, modelField, heightField, tipField, groupField;
            // modelField, heightField, tipField, groupField have not been
            // implemented yet; for panel 3
    //
    private JEditorPane scrollListContent;
    private JTextArea enteredContent;
    private JList enteredItemsList, loadedList;

    // Labels for field input identifier
    private JLabel quantityLabel, thicknessLabel,
            widthLabel, colorLabel, plysLabel,
            productionLabel, informLabel, specifyLabel,
            plys1Label, color1Label, quantity1Label,
            model1Label, thickness1Label, width1Label,
            helper1Label, helper2Label, helper3Label,
            helper4Label, helper5Label;

    // The three tab panels
    private JPanel panel1, panel2, panel3;

    // Combobox selection system
    private JComboBox modelComboBox, colorComboBox;

    private JScrollPane orderScrollPane, enteredScrollPane;

    private JButton
        loadModelsButton, enterButton, removeTempItemsButton,
        saveListButton, deleteModelsButton, modelInfoButton,
        modelButton, thicknessButton, widthButton, colorButton,
        loadListButton;

    private javax.swing.JButton clearListButton,          // NOTE: saveModelB, loadModelB, delModelB pertain to the
        saveModelB,         loadModelB,         delModelB;
    private Vector<Model> modelList;
    private String[] colors = {"Green", "Teal", "Dark Blue", "White", "Gray"};
    private OrderList prodList;

    private TreeClassics()
    {
        // GUI Setup for program
        super("Tree Classics Production Line"); …
buggytoast 0 Newbie Poster

Hey thanks everyone...It works now :D.

BTW as a side note, my teacher doesn't want me to use "vectors" cuz it shows implementation and not "mastery". I just go get the source code and change the variables right?

buggytoast 0 Newbie Poster

Sincerest apologies. What happens is that I save the file no problem however when I move to panel 2 to load the file, it fails to display. Hope that covers everything. PEace.

buggytoast 0 Newbie Poster

Hi everyone! (it's been awhile XD)
I've gone and done my homework. And here I am with a program that works...pretty well I think.

There appears to be a problem with the saving/loading. Originally it worked without a problem, but when I attempted to make it more graphically friendly (when it displays in the list), the file saves, however I can't load it in panel 2.

You can get a 'Load Model Set', by just copy pasting the data below. Put it into a text file. (notepad)

48-209-351 1.3 300 5
60-344-351 1.45 250 12
72-554-351 1.32 200 9
84-754-351 1.35 350 3
96-1042-351 1.4 280 7

As I said before, originally it works, but now it doesn't. I'm nearing a deadline and I have to do uber documentation, can anyone help? I hope this is enough effort lol. Peace guys :D

PLEASE DO NOT COPY!!!!!!!

Here is Class TreeClassics

// TreeClassics Program
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;

public class TreeClassics extends JFrame
{
    //include aspects of GUI
    private JTextField quantityField, thicknessField, widthField,
            plysField, modelField, heightField, tipField, groupField;
            // modelField, heightField, tipField, groupField have not been
            // implemented yet; for panel 3
    //
    private JEditorPane scrollListContent;
    private JTextArea enteredContent;
    private JList enteredItemsList, loadedList, buggerList;

    // Labels for field input identifier
    private JLabel quantityLabel, thicknessLabel,
            widthLabel, colorLabel, plysLabel,
            productionLabel, informLabel, specifyLabel, helpLabel,
            help2Label, help3Label, help4Label, help5Label,
            model1Label, quantity1Label, width1Label, plys1Label,
            color1Label, thickness1Label;

    // The …
buggytoast 0 Newbie Poster

The program is 90% done :D...everything works except for one little thing...
THe date doesn't appear to be working :( I tried messing around with the true false but it doesn't seem to have any affect....any one know the problem? Any help would be appreciated :D

// Comsci Dossier

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
import javax.swing.border.*;
import java.text.*;

public class AirBox extends JFrame {
    private JComboBox destinationComboBox, mealComboBox, classComboBox, dayComboBox, displayComboBox, editComboBox, mealComboBox1, classComboBox1, flightComboBox;
    // JTEXT AREAS
    private JTextArea customerArea, searchResultArea, manifestArea;
    // JTEXTFIELDS
    private JTextField FirstNameField, LastNameField, mealField, flightField, deleteField, editField, searchField, searchField1, changeNameField;
    // JLABELS
    private JLabel FirstNameLabel, LastNameLabel, mealLabel, classLabel, customerLabel, MHSLabel, CMLabel, flightLabel, deleteLabel, editLabel, searchLabel, searchLabel1, businessNameJLabel;
    //JBUTTONS
    private JButton addButton, saveButton, loadButton, deleteButton, searchButton,
            changeLastNameButton, newButton, ticketButton;
    // SCROLLER
    private JScrollPane customerListScrollPane;
    //JRADIO BUTTONS
    private JRadioButton inputRadio, editRadio, searchRadio;
    // BUTTON GROUP
    private ButtonGroup displayGroup;
    //JPANELS
    private JPanel editPanel, mainPanel, searchPanel;
    // STRING for JCOMBOBOX
    private String meal[] = { "Select Meal Type...", "Vegetarian","Meat" };
    private String classS[] = { "Select Class...", "Business Class", "Second Class" };
    private String editCh[] = { "Choose Data to edit...","Change First Name","Change Last Name","Change Meal Type"};
    private String display[] = { "Manifest", "Seating Chart"};    
    private String destinations[] = { "Select Destination", "Mae Hong Son", "Chiang Mai"};
    private String meals[] = { "Select Meal", "Normal", "Vegetarian" }; 
    private String classes[] = { "Select Class", "Normal", "Business" };
    private String day[] = { "Select Day...", "Monday", "Tuesday", "Wednesday",
                             "Thursday", "Friday" };
                         
    
    // INITIALIZE ObjectOutputStream …
buggytoast 0 Newbie Poster

Here...passengerdata

import java.io.Serializable;
import javax.swing.*;

public class PassengerData implements Serializable
{
    
    private String firstName;
    private String lastName;
    private String mealType;
    private String seat;
    private String classType;
    private String flightNo;
    private int checkEnter;
    
    public PassengerData() {
        firstName = "";
        lastName = "";
        mealType = "";
        seat = "";
        classType = "";
        flightNo = "";
        checkEnter = 0;
    }
           
    public PassengerData( String fName, String lName, String mealT, String sT, String classT, String flightN, int checkE )
    {
        setRecord( fName, lName, mealT, sT, classT, flightN, checkE );
    }
    
    public void setRecord( String fName, String lName, String mealT, String sT, String classT, String flightN, int checkE )
    {
        firstName = fName;
        lastName = lName;
        mealType = mealT;
        seat = sT;        
        classType = classT;
        flightNo = flightN;
        checkEnter = checkE;
    }
        
     public String getFirstName()
    {
        return firstName;
    }

    public String getLastName()
    {
        return lastName;
    }   

    public String getMealType()
    {
        return mealType;
    }    
    
    public String getSeat()
    {
        return seat;
    }
    
    public String getClassType()
    {
        return classType;
    }
    
    public String getflightNo()
    {
        return flightNo;
    }
    
    public int getCheckEnter(){
        
        return checkEnter;
    }
}
buggytoast 0 Newbie Poster

Hi Everyone! THis is my final program :D
Of course it's not done...but I just wanted some feedback...and any ideas on how to fix my GUI XD...Any help is appreciated ^^. BUt please don't copy lol XD I don't want to get accused of cheating here...if giving out this code is a mistake, I'll let the mods decide what to do.

// 
// copyright buggytoast
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
import javax.swing.border.*;

public class AirBox extends JFrame {
    private JComboBox destinationComboBox, mealComboBox, classComboBox, dayComboBox, displayComboBox, editComboBox, mealComboBox1, classComboBox1;
    // JTEXT AREAS
    private JTextArea customerArea, searchResultArea;
    // JTEXTFIELDS
    private JTextField FirstNameField, LastNameField, mealField, flightField, deleteField, editField, searchField, searchField1, changeNameField;
    // JLABELS
    private JLabel FirstNameLabel, LastNameLabel, mealLabel, classLabel, customerLabel, MHSLabel, CMLabel, flightLabel, deleteLabel, editLabel, searchLabel, searchLabel1;
    //JBUTTONS
    private JButton addButton, saveButton, loadButton, deleteButton, searchButton,
            changeLNameButton, newButton, ticketButton;
    // SCROLLER
    private JScrollPane customerListScrollPane;
    //JRADIO BUTTONS
    private JRadioButton inputRadio, editRadio, searchRadio;
    // BUTTON GROUP
    private ButtonGroup displayGroup;
    //JPANELS
    private JPanel editPanel, mainPanel, searchPanel;
    // STRING for JCOMBOBOX
    private String meal[] = { "Select Meal Type...", "Vegetarian","Meat","Children's Diet","Elderly Diet" };
    private String classS[] = { "Select Class...", "First Class", "Second Class" };
    private String editCh[] = { "Choose Data to edit...","Change First Name","Change Last Name","Change Meal Type"};
    private String display[] = { "Manifest", "Seating Chart"};    
    private String destinations[] = { "Select Destination", "Mae Hong Son", "Chiang Mai"};
    private String meals[] = { "Select Meal", "Normal", "Vegetarian" }; 
    private String classes[] = { "Select Class", "Normal", "Business" };
    private String day[] …
buggytoast 0 Newbie Poster

WEll i managed to fix it...
altho here's the main problem i was addressing...
see how it cramps up?
[IMG]http://img179.echo.cx/img179/7200/error6xa.th.jpg[/IMG]

buggytoast 0 Newbie Poster

Heres my program...so far.
The applet is not initiliazing now and I have no idea why...
It's unfinished so yeah alot of the stuff is unused so far XD
SOrry i couldn't put up a pic

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
import javax.swing.border.*;

public class ReservationProgram extends JFrame {
    
    private JLabel phoneLabel, firstLabel, lastLabel, dateLabel, mealLabel;
    private JTextField phoneTextField, firstTextField, lastTextField, dateTextField, mealTextField;
    private JComboBox mealComboBox, classComboBox, destinationComboBox;
    private String destinations[] = { "Select Destination", "Mae Hong Son", "Chiang Mai"};
    private String meals[] = { "Select Meal", "Normal", "Vegetarian" }; 
    private String classes[] = { "Select Class", "Normal", "Business" };
    private CustomerInfo List[];
    
    private JButton addButton, saveButton, loadButton, deleteButton, searchButton,
            changeNameButton, changeLNameButton, changeMealButton, changeSeatButton,
            editButton, cancelButton, newButton;
    
    // Gui Setup
    public ReservationProgram()
    {
        super( "Airlines Reservation");
        // create JTabbed Pane
        
        JTabbedPane tabbedPane = new JTabbedPane();

        // set up panel1 and add to JTabbedPane
        JLabel label1 = new JLabel( "AIRLINE RESERVATION", SwingConstants.CENTER );
        JPanel panel1 = new JPanel();
	panel1.add( label1 );
        tabbedPane.addTab( "RESERVING", null, panel1, "FirstPanel");
        
        mealComboBox = new JComboBox( meals );
        panel1.add( mealComboBox );
        mealComboBox.setBounds( 200, 200, 170, 20 );
        mealComboBox.setSelectedIndex( 0 );
        
        classComboBox = new JComboBox( classes );
        panel1.add( classComboBox );
        classComboBox.setBounds( 200, 200, 170, 20 );
        classComboBox.setSelectedIndex( 0 );
        
        destinationComboBox = new JComboBox( destinations );
        panel1.add( destinationComboBox );
        destinationComboBox.setBounds( 200, 200, 170, 20 );
        destinationComboBox.setSelectedIndex( 0 );
        
        firstLabel = new JLabel ( "First Name:" );
        panel1.add( firstLabel );
        firstLabel.setBounds( 50, 20, 100, 20 );
        
        firstTextField = new JTextField();
        panel1.add( firstTextField ); …
buggytoast 0 Newbie Poster

Well the title prett much tells you what error I have XD...

so far....

JLabel label1 = new JLabel( "AIRLINE RESERVATION", SwingConstants.CENTER );
        JPanel panel1 = new JPanel();
	panel1.add( label1 );
        tabbedPane.addTab( "RESERVING", null, panel1, "FirstPanel");

then heres the problem....

mealComboBox = new JComboBox( meals );
        panel1.add( mealComboBox );
        mealComboBox.setBounds( 200, 200, 170, 20 );
        mealComboBox.setSelectedIndex( 0 );

the setbounds is definetely wrong...use that for container :( I keep tryin but it doesn't seem to work...and i'm not experienced enough to use GridBagLayout

If anyone can help, that would be greatly appreciated.

buggytoast 0 Newbie Poster

WEll I'm kinda new to Java programming...but we got a major project coming up and I got stuck on one of the examples. This is for a validation code, to validate correct inputs....the errors are highlighted in red...Thanks to anyone that bothered to help :P I'm sure the answer is really basic but i tried flipping stuff around and it doesn't work :evil: supposedly i'm missing an ")" but no friggin idea where. -__-ll

// Airlines Reservation program
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Airlines extends JFrame {
private JTextField phoneTextField, firstTextField, lastTextField, dateTextField, addressTextField;

/** Creates a new instance of Airlines */
public Airlines() {
super ( "Airlines");
JLabel phoneLabel = new JLabel( "Phone" );
JLabel firstLabel = new JLabel( "First Name" );
JLabel lastLabel = new JLabel( "Last Name" );
JLabel dateLabel = new JLabel( "Date" );
JLabel addressLabel = new JLabel( "Address" );
JButton okButton = new JButton( "OK" );
okButton.addActionListener( new ActionListener(){
public void actionPerformed( ActionEvent event ){
validateDate();
}
}
);
phoneTextField = new JTextField( 15 );
firstTextField = new JTextField( 5 );
lastTextField = new JTextField( 2 );
addressTextField = new JTextField( 12 );
dateTextField = new JTextField( 20 );
JPanel firstName = new JPanel();
firstName.add( firstLabel );
firstName.add( firstTextField );
JPanel lastName = new JPanel();
lastName.add( lastLabel );
lastName.add( lastTextField );
JPanel address = new JPanel();
address.add( addressLabel );
address.add( addressTextField );
JPanel date = new JPanel();
date.add( dateLabel );
date.add( dateTextField );
JPanel phone = new JPanel();
phone.add( phoneLabel …
buggytoast 0 Newbie Poster

I want to use "sumif" function in an excel worksheet, but I have 2 criteria I must fulfill. How would I got about doing that?

I am currently running windows XP and using the office 2003 for Excel. Any help would be appreciated. Thanks