| | |
homework(easy): Java GUI/Netbeans using java.util.LinkedList
![]() |
•
•
Join Date: Mar 2007
Posts: 7
Reputation:
Solved Threads: 0
Hello i have an important homework assignment which is due up on mon 26th and i need a competent java programmer with netbeans expirence. Problem is as follows:
It's a small project and i have basically designed all the forms and buttons needed etc. Now i need someone to link my buttons to classes that use the java.util.LinkedList / Iratator / Serializable functions to just store basic infomations from text fields into a linked list and then into a user specified text file, where i can then search, add, delete etc ..
Its worth about 10% of my final grade, and due on monday so contact me asap ill pay 200$
collegestuffs@safe-mail.net
It's a small project and i have basically designed all the forms and buttons needed etc. Now i need someone to link my buttons to classes that use the java.util.LinkedList / Iratator / Serializable functions to just store basic infomations from text fields into a linked list and then into a user specified text file, where i can then search, add, delete etc ..
Its worth about 10% of my final grade, and due on monday so contact me asap ill pay 200$
collegestuffs@safe-mail.net
•
•
Join Date: Mar 2007
Posts: 7
Reputation:
Solved Threads: 0
I am familar with creating this type of application without a GUI builder.. homework spec doesnt insist on a GUI builder, but i feel netbeans adds more functionalitys quicker and im sure id get higher grades .
As the netbeans generated code can be quite long i put the netbeans generated code onto this paste bin: http://rafb.net/p/ho7SKr98.html
As the netbeans generated code can be quite long i put the netbeans generated code onto this paste bin: http://rafb.net/p/ho7SKr98.html
Last edited by collegestuffs; Mar 24th, 2007 at 2:21 pm.
•
•
Join Date: Mar 2007
Posts: 7
Reputation:
Solved Threads: 0
well this is the first time i have attempted to make a gui with so many menus and a login system with netbeans, and also i am unlear on how to use the:
java.Util.LinkedList for the linked list as i have only used my own code to initate the nodes etc, why re-invent the wheel?
and a way to save the list using
serializable (?) or bufferered reader
and then doing searches on it for specific records, maybe implement a grep util i have code for,
all the time i just really need like 10 JTextFields and 6 buttons working it....
java.Util.LinkedList for the linked list as i have only used my own code to initate the nodes etc, why re-invent the wheel?

and a way to save the list using
serializable (?) or bufferered reader
and then doing searches on it for specific records, maybe implement a grep util i have code for,
all the time i just really need like 10 JTextFields and 6 buttons working it....
Last edited by collegestuffs; Mar 24th, 2007 at 2:36 pm.
•
•
Join Date: Mar 2007
Posts: 7
Reputation:
Solved Threads: 0
i managed to knock up a GUI with GUIGenie and it compiles fine in JCreator. now i need someone to help me implement the java.Util.LinkedList and other classes so i can save/read/delete from the linked list !
code is as below:
code is as below:
Java Syntax (Toggle Plain Text)
///Generated by GuiGenie - Copyright (c) 2004 Mario Awad. //Home Page <a rel="nofollow" class="t" href="http://guigenie.cjb.net" target="_blank">http://guigenie.cjb.net</a> - Check often for new versions! import java.io.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; public class stockControlSystem extends JFrame implements ActionListener, WindowListener { private JLabel productIdLabel; private JTextField productIDField; private JLabel productTypeLabel; private JTextField productTypeField; private JTextField productPriceField; private JLabel productPriceLabel; private JLabel quantityInStockLabel; private JTextField qInStockField; private JLabel reOrderLabel; private JTextField reOrderField; private JLabel reOrderQLabel; private JTextField reOrderQField; private JTextField costPriceField; private JButton firstRecordButton; private JButton addRecordButton; private JButton searchButton; private JButton nextButton; private JButton clearButton; private JButton lastRecordButton; private JButton previousRecordButton; private JButton deleteRecordButton; private JLabel costLabel; private JTextField supplierIdField; private JLabel jcomp27; private JLabel supplierIdLabel; private JLabel menuTitleLabel; //private JLabel jcomp29; private FileOutputStream fos; private PrintWriter out; public stockControlSystem(String str) throws IOException{ super(str); fos = new FileOutputStream("AccountFile.txt", true); out = new PrintWriter(new OutputStreamWriter(fos)); //construct components productIdLabel = new JLabel ("Product ID:"); productIDField = new JTextField (5); productTypeLabel = new JLabel ("Product Type:"); productTypeField = new JTextField (5); productPriceField = new JTextField (5); productPriceLabel = new JLabel ("Product Price:"); quantityInStockLabel = new JLabel ("Quantity In Stock:"); qInStockField = new JTextField (5); reOrderLabel = new JLabel ("Re- Order Level:"); reOrderField = new JTextField (5); reOrderQLabel = new JLabel ("Re- Order Quantity:"); reOrderQField = new JTextField (5); costPriceField = new JTextField (5); firstRecordButton = new JButton ("First Record"); addRecordButton = new JButton ("Add Record"); searchButton = new JButton ("Search Record"); nextButton = new JButton ("Next Record"); clearButton = new JButton ("Clear"); lastRecordButton = new JButton ("Last Record"); previousRecordButton = new JButton ("Previous Record"); deleteRecordButton = new JButton ("Delete Record"); costLabel = new JLabel ("Cost Price:"); supplierIdField = new JTextField (5); jcomp27 = new JLabel ("newLabel"); supplierIdLabel = new JLabel ("Supplier ID:"); menuTitleLabel = new JLabel (" "); setSize(448,519); //add components add (productIdLabel); add (productIDField); add (productTypeLabel); add (productTypeField); add (productPriceField); add (productPriceLabel); add (quantityInStockLabel); add (qInStockField); add (reOrderLabel); add (reOrderField); add (reOrderQLabel); add (reOrderQField); add (costPriceField); add (firstRecordButton); add (addRecordButton); add (searchButton); add (nextButton); add (clearButton); add (lastRecordButton); add (previousRecordButton); add (deleteRecordButton); add (costLabel); add (supplierIdField); add (jcomp27); add (supplierIdLabel); add (menuTitleLabel); //set component bounds (only needed by Absolute Positioning) productIdLabel.setBounds (30, 75, 100, 25); productIDField.setBounds (160, 75, 155, 25); productTypeLabel.setBounds (30, 110, 100, 25); productTypeField.setBounds (160, 105, 155, 30); productPriceField.setBounds (160, 140, 155, 25); productPriceLabel.setBounds (35, 140, 100, 25); quantityInStockLabel.setBounds (30, 180, 100, 25); qInStockField.setBounds (160, 180, 155, 25); reOrderLabel.setBounds (30, 220, 100, 25); reOrderField.setBounds (160, 220, 155, 25); reOrderQLabel.setBounds (25, 250, 120, 35); reOrderQField.setBounds (160, 255, 155, 25); costPriceField.setBounds (160, 290, 155, 25); firstRecordButton.setBounds (15, 370, 115, 50); addRecordButton.setBounds (135, 405, 160, 30); searchButton.setBounds (135, 440, 160, 30); nextButton.setBounds (305, 425, 135, 45); clearButton.setBounds (330, 75, 100, 25); lastRecordButton.setBounds (15, 425, 115, 45); previousRecordButton.setBounds (305, 370, 135, 50); deleteRecordButton.setBounds (135, 370, 160, 30); costLabel.setBounds (25, 285, 100, 25); supplierIdField.setBounds (160, 325, 155, 25); jcomp27.setBounds (610, 175, 120, 25); supplierIdLabel.setBounds (25, 320, 100, 25); menuTitleLabel.setBounds (35, 10, 10, 35); nextButton.addActionListener(this); clearButton.addActionListener(this); previousRecordButton.addActionListener(this); addRecordButton.addActionListener(this); deleteRecordButton.addActionListener(this); searchButton.addActionListener(this); lastRecordButton.addActionListener(this); firstRecordButton.addActionListener(this); //set window listener listening this.addWindowListener(this); setVisible(true); } public void windowActivated(WindowEvent e) {} public void windowClosed(WindowEvent e){} public void windowClosing(WindowEvent e) {System.exit(0);} public void windowDeactivated(WindowEvent e) {} public void windowDeiconified(WindowEvent e) {} public void windowIconified(WindowEvent e) {} public void windowOpened(WindowEvent e) {} public void actionPerformed(ActionEvent e) { Object target = e.getSource(); if (target == addRecordButton) { String s1 = productIDField.getText(); s1.trim(); out.println(s1); productIDField.setText(""); } if (target == firstRecordButton) { productIDField.setText(""); } } public static void main (String[] args) throws IOException{ stockControlSystem F1 = new stockControlSystem("Stock Control Menu"); } }
Last edited by collegestuffs; Mar 24th, 2007 at 9:20 pm.
•
•
Join Date: Mar 2007
Posts: 7
Reputation:
Solved Threads: 0
i have continued with the code above and have tried to implement the linked list re-inventing the wheel ... any ideas guys to make the list work and print into the textfields?
Java Syntax (Toggle Plain Text)
///Generated by GuiGenie - Copyright (c) 2004 Mario Awad. //Home Page <a rel="nofollow" class="t" href="http://guigenie.cjb.net" target="_blank">http://guigenie.cjb.net</a> - Check often for new versions! import java.io.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; public class stockControlSystem extends JFrame implements ActionListener, WindowListener { private JLabel productIdLabel; private JTextField productIDField; private JLabel productTypeLabel; private JTextField productTypeField; private JTextField productPriceField; private JLabel productPriceLabel; private JLabel quantityInStockLabel; private JTextField qInStockField; private JLabel reOrderLabel; private JTextField reOrderField; private JLabel reOrderQLabel; private JTextField reOrderQField; private JTextField costPriceField; private JButton firstRecordButton; private JButton addRecordButton; private JButton searchButton; private JButton nextButton; private JButton clearButton; private JButton lastRecordButton; private JButton previousRecordButton; private JButton deleteRecordButton; private JLabel costLabel; private JTextField supplierIdField; private JLabel jcomp27; private JLabel supplierIdLabel; private JLabel menuTitleLabel; //private JLabel jcomp29; private FileOutputStream fos; private PrintWriter out; public stockControlSystem(String str) throws IOException{ super(str); fos = new FileOutputStream("AccountFile.txt", true); out = new PrintWriter(new OutputStreamWriter(fos)); //construct components productIdLabel = new JLabel ("Product ID:"); productIDField = new JTextField (5); productTypeLabel = new JLabel ("Product Type:"); productTypeField = new JTextField (5); productPriceField = new JTextField (5); productPriceLabel = new JLabel ("Product Price:"); quantityInStockLabel = new JLabel ("Quantity In Stock:"); qInStockField = new JTextField (5); reOrderLabel = new JLabel ("Re- Order Level:"); reOrderField = new JTextField (5); reOrderQLabel = new JLabel ("Re- Order Quantity:"); reOrderQField = new JTextField (5); costPriceField = new JTextField (5); firstRecordButton = new JButton ("First Record"); addRecordButton = new JButton ("Add Record"); searchButton = new JButton ("Search Record"); nextButton = new JButton ("Next Record"); clearButton = new JButton ("Clear"); lastRecordButton = new JButton ("Last Record"); previousRecordButton = new JButton ("Previous Record"); deleteRecordButton = new JButton ("Delete Record"); costLabel = new JLabel ("Cost Price:"); supplierIdField = new JTextField (5); jcomp27 = new JLabel ("newLabel"); supplierIdLabel = new JLabel ("Supplier ID:"); menuTitleLabel = new JLabel (" "); //adjust size and set layout //setPreferredSize (new Dimension (448, 519)); //setLayout (null); setSize(448,519); //add components add (productIdLabel); add (productIDField); add (productTypeLabel); add (productTypeField); add (productPriceField); add (productPriceLabel); add (quantityInStockLabel); add (qInStockField); add (reOrderLabel); add (reOrderField); add (reOrderQLabel); add (reOrderQField); add (costPriceField); add (firstRecordButton); add (addRecordButton); add (searchButton); add (nextButton); add (clearButton); add (lastRecordButton); add (previousRecordButton); add (deleteRecordButton); add (costLabel); add (supplierIdField); add (jcomp27); add (supplierIdLabel); add (menuTitleLabel); //set component bounds (only needed by Absolute Positioning) productIdLabel.setBounds (30, 75, 100, 25); productIDField.setBounds (160, 75, 155, 25); productTypeLabel.setBounds (30, 110, 100, 25); productTypeField.setBounds (160, 105, 155, 30); productPriceField.setBounds (160, 140, 155, 25); productPriceLabel.setBounds (35, 140, 100, 25); quantityInStockLabel.setBounds (30, 180, 100, 25); qInStockField.setBounds (160, 180, 155, 25); reOrderLabel.setBounds (30, 220, 100, 25); reOrderField.setBounds (160, 220, 155, 25); reOrderQLabel.setBounds (25, 250, 120, 35); reOrderQField.setBounds (160, 255, 155, 25); costPriceField.setBounds (160, 290, 155, 25); firstRecordButton.setBounds (15, 370, 115, 50); addRecordButton.setBounds (135, 405, 160, 30); searchButton.setBounds (135, 440, 160, 30); nextButton.setBounds (305, 425, 135, 45); clearButton.setBounds (330, 75, 100, 25); lastRecordButton.setBounds (15, 425, 115, 45); previousRecordButton.setBounds (305, 370, 135, 50); deleteRecordButton.setBounds (135, 370, 160, 30); costLabel.setBounds (25, 285, 100, 25); supplierIdField.setBounds (160, 325, 155, 25); jcomp27.setBounds (610, 175, 120, 25); supplierIdLabel.setBounds (25, 320, 100, 25); menuTitleLabel.setBounds (35, 10, 10, 35); nextButton.addActionListener(this); clearButton.addActionListener(this); previousRecordButton.addActionListener(this); addRecordButton.addActionListener(this); deleteRecordButton.addActionListener(this); searchButton.addActionListener(this); lastRecordButton.addActionListener(this); firstRecordButton.addActionListener(this); //set window listener listening w00t this.addWindowListener(this); //setBackGround(Color, white); setVisible(true); } public void windowActivated(WindowEvent e) {} public void windowClosed(WindowEvent e){} public void windowClosing(WindowEvent e) {System.exit(0);} public void windowDeactivated(WindowEvent e) {} public void windowDeiconified(WindowEvent e) {} public void windowIconified(WindowEvent e) {} public void windowOpened(WindowEvent e) {} public void actionPerformed(ActionEvent e) { //Object target = e.getSource(); if (target == addRecordButton) { /*String s1 = productIDField.getText(); s1.trim(); out.println(s1);*/ NodeList L1 = new NodeList(); L1.insert(productIDField); productIDField.setText(""); productTypeField.setText(L1.p1); } if (target == firstRecordButton) { } } class Node { public String productID; /* public String productType; public int productPrice; public int quantityInStock; public int reorderLevel; public int reorderQuanitity; public int costPrice; public int supplierId;*/ public Node next; public Node(int p1)//, String p2, int p3, int p4, int p5, int p6, int p7, int p8) { productID = new String (p1); /* productType = new String[p2]; productPrice = new int[p3]; quantityInStock = new int[p4]; reorderLevel = new int[p5]; reorderQuantity = new int [p6]; costPrice = new int[p7]; supplierId = new int [p8];*/ } public int readName(){return productID;} } } class NodeList { private Node head; public NodeList(){head = null;} public void insert(String id)//String pT, int pP, int qIS, int rL, int rQ, int cP, int sId) { Node temp = new Node(id);//, pT, pP, qIS, rL, rQ, cP, sId); temp.next = head; head = temp; } } public static void main (String args[]) throws IOException{ stockControlSystem F1 = new stockControlSystem("Stock Control Menu"); } }
![]() |
Other Threads in the Java Forum
- Previous Thread: I need help
- Next Thread: Detecting model owner from inside model
| Thread Tools | Search this Thread |
account android applet application apps array automation awt bidirectional binary birt bluetooth businessintelligence busy_handler(null) card class classes client code collision columns component constructor database designadrawingapplicationusingjavajslider draw eclipse error eventlistener exception expand fractal free game givemetehcodez graphics gui guidancer homework html ide image inheritance integer integration intellij j2me java javafx javamicroeditionuseofmotionsensor javaprojects jlabel jme jni jpanel jtextfield jtree julia linux loop method midlethttpconnection migrate mobile mobiledevelopmentcreatejar monitoring myaggfun netbeans newbie nullpointerexception open-source oracle plazmic print problem program property ria scanner server set sharepoint smart sms smsspam sourcelabs splash sql sqlite subclass support swing testautomation textfield threads tree trolltech unlimited utility windows





