PLease help! GUI and Data Structure

Hey guys,
It's for my school project.
I have to write codes for GUI program for a order form.
I'm pretty much done with layout and stuff, but I couldn't figure out how to give some regulation(?) on some of the field.
For instantce, I have to regulate a user to type only two letter abbreviation on state(address) field and the Zip field has to be either 5 digit form or XXXXX-XXXX.
I Also have to include code to filter the user input and display error message if they enter wrong information.
Second, how to use actoinevent stuff?
There are three product type: a,b, and c. If "a" be chosen, then the product name associating the "a" product has to be shown on the product name field(I used ComboBox), and the price for that product(for instance a-1) has to be shown on the price field.
Third, It sounds stupid question, but how to display current date on the java program using API?
Fourth, I have to load some of the order from external files(maybe text files) and display into the screen.
Here is the code
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
class orderFormGUI extends JFrame {
     private JButton bSave, bExit, bLoad;
     private JLabel labelTitle;
     private JTextField fieldFName, fieldLName, fieldStreet, fieldCity,
               fieldState, fieldZip;
     private JLabel labelFName, labelLName, labelStreet, labelCity, labelState,
               labelZip;
     private String[] st = { "CA", "TX", "OR", "UT", "NM", "NY", "NY", "GA",
               "IL", "TN", "MN", "WY" };
     private JComboBox comboPType, comboPName;
     private JLabel labelComboPType, labelComboPName;
     private String[] ct = { "Copmuter", "Printer", "Monitor" };
     private String[] cn = { "CMP1100", "CMP1500" };
     private String[] pn = { "PR500", "PR1000" };
     private String[] mn = { "D4000", "D8000" };
     private String[] x;
     private JTextField fieldTotalPrice, fieldProductPrice;
     private JLabel labelTotalPrice, labelProductPrice;
     private JTextField filedQty;
     private JLabel labelQty;
     private JTextField fieldOrderDate, fieldDeliveryDate;
     private JComboBox comboDeliveryOptions;
     private String[] dO = { "5 Days", "10 Days" };
     private JLabel labelOrderDate, labelDeliveryOptions, labelDeliveryDate;
     private ArrayList orderArray;
     private DefaultListModel lmodel;
     public void initComponents() {
          bSave.setActionCommand("Save");
          bLoad.setActionCommand("Load");
          bExit.setActionCommand("Exit");
          bSave.addActionListener(new ButtonListener());
          bLoad.addActionListener(new ButtonListener());
          bExit.addActionListener(new ButtonListener());
     public void ClearFields() {
          // Set all text fields to blank
          fieldFName.setText("");
          fieldLName.setText("");
          fieldStreet.setText("");
          fieldCity.setText("");
          fieldState.setText("");
          fieldZip.setText("");
     public orderFormGUI() {
          orderArray = new ArrayList();
          bSave = new JButton("Save");
          bLoad = new JButton("Load");
          bExit = new JButton("Exit");
          // set up labels and field size for GUI
          labelTitle = new JLabel("Order Form");
          fieldFName = new JTextField("", 30);
          labelFName = new JLabel("First Name: ");
          fieldLName = new JTextField("", 30);
          labelLName = new JLabel("Last Name: ");
          fieldStreet = new JTextField("", 12);
          labelStreet = new JLabel("Street: ");
          fieldCity = new JTextField("", 12);
          labelCity = new JLabel("City: ");
          fieldState = new JTextField("", 2);
          labelState = new JLabel("State: ");
          fieldZip = new JTextField("", 9);
          labelZip = new JLabel("Zip Code: ");
          comboPType = new JComboBox(ct);
          chooseProductName();
          labelComboPType = new JLabel("Product Type");
          comboPName = new JComboBox();
          labelComboPName = new JLabel("Product Name");
          fieldProductPrice = new JTextField("");
          labelProductPrice = new JLabel("Product Price: ");
          fieldTotalPrice = new JTextField("", 12);
          labelTotalPrice = new JLabel("Total Price: ");
          filedQty = new JTextField("", 12);
          labelQty = new JLabel("Quantity: ");
          fieldOrderDate = new JTextField("", 12);
          labelOrderDate = new JLabel("Order Date: ");
          comboDeliveryOptions = new JComboBox(dO);
          labelDeliveryOptions = new JLabel("Delivery Options: ");
          fieldDeliveryDate = new JTextField("", 12);
          labelDeliveryDate = new JLabel("Delivery Date: ");
          TextFieldHandler handler = new TextFieldHandler();
          fieldState.addActionListener(handler);
          // Construct GUI and set layout
          JPanel mine = new JPanel();
          mine.setLayout(null);
          mine.add(labelTitle);
          labelTitle.setBounds(150, 30, 100, 15);
          mine.add(fieldFName);
          fieldFName.setBounds(88, 80, 220, 21);
          mine.add(labelFName);
          labelFName.setBounds(16, 80, 134, 21);
          mine.add(fieldLName);
          fieldLName.setBounds(88, 110, 220, 21);
          mine.add(labelLName);
          labelLName.setBounds(16, 110, 134, 21);
          mine.add(fieldStreet);
          fieldStreet.setBounds(88, 150, 220, 21);
          mine.add(labelStreet);
          labelStreet.setBounds(16, 150, 134, 21);
          mine.add(fieldCity);
          fieldCity.setBounds(88, 180, 220, 21);
          mine.add(labelCity);
          labelCity.setBounds(16, 180, 134, 21);
          mine.add(fieldState);
          fieldState.setBounds(88, 210, 220, 21);
          mine.add(labelState);
          labelState.setBounds(16, 210, 134, 21);
          mine.add(fieldZip);
          fieldZip.setBounds(88, 240, 220, 21);
          mine.add(labelZip);
          labelZip.setBounds(16, 240, 134, 21);
          mine.add(comboPType);
          comboPType.setBounds(120, 280, 220, 21);
          mine.add(labelComboPType);
          labelComboPType.setBounds(16, 280, 134, 21);
          mine.add(comboPName);
          comboPName.setBounds(120,310, 220, 21);
          mine.add(labelComboPName);
          labelComboPName.setBounds(16, 310, 134, 21);
          mine.add(fieldProductPrice);
          fieldProductPrice.setBounds(120, 340, 220, 21);
          fieldProductPrice.setEditable(false);
          mine.add(labelProductPrice);
          labelProductPrice.setBounds(16, 340, 134, 21);
          mine.add(filedQty);
          filedQty.setBounds(120, 370, 220, 21);
          mine.add(labelQty);
          labelQty.setBounds(16, 370, 134, 21);
          mine.add(fieldOrderDate);
          fieldOrderDate.setBounds(120, 430, 220, 21);
          fieldOrderDate.setEditable(false);
          mine.add(labelOrderDate);
          labelOrderDate.setBounds(16, 430, 134, 21);
          mine.add(comboDeliveryOptions);
          comboDeliveryOptions.setBounds(120, 460, 220, 21);
          mine.add(labelDeliveryOptions);
          labelDeliveryOptions.setBounds(16, 460, 134, 21);
          mine.add(fieldDeliveryDate);
          fieldDeliveryDate.setBounds(120, 490, 220, 21);
          fieldDeliveryDate.setEditable(false);
          mine.add(labelDeliveryDate);
          labelDeliveryDate.setBounds(16, 490, 134, 21);
          mine.add(fieldTotalPrice);
          fieldTotalPrice.setBounds(120, 520, 220, 21);
          fieldTotalPrice.setEditable(false);
          mine.add(labelTotalPrice);
          labelTotalPrice.setBounds(16, 520, 134, 21);
          mine.add(bSave);
          bSave.setBounds(16, 550, 100, 21);
          mine.add(bLoad);
          bLoad.setBounds(130, 550, 100, 21);
          mine.add(bExit);
          bExit.setBounds(250, 550, 100, 21);
          this.setContentPane(mine);
          this.pack();
          this.setTitle("Order Form);
          Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
          setSize(380, 630);
     public void chooseProductName(){
          if ((ct).equals(ct[0])){
               comboPName = new JComboBox(cn);
          }else if (ct.equals(ct[1])){
               comboPName = new JComboBox(pn);
          }else if (ct.equals(ct[2])){
               comboPName = new JComboBox(mn);
     public void comboPNameChanged(ItemEvent event){
          if (event.getStateChange() == ItemEvent.SELECTED);
     private void setTestData() {
          orderArray.add(makeOrder("1-100-1000"));
          orderArray.add(makeOrder("1-100-1001"));
          orderArray.add(makeOrder("1-100-1002"));
          for (Order temp : orderArray) {
               if (temp.getOrder().equals("1-100-1000")) {
                    temp.setfName("a");
                    temp.setlName("s");
                    temp.setstreet("4802 Alaska Ave");
                    temp.setcity("Cypress");
                    temp.setzip("90630");
     private Order makeOrder(String order) {
          Order temp = new Order(order);
          return temp;
     private void loadDate(){
     String fn;
     JFileChooser fc = new JFileChooser();
     if(fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION){
          fn = fc.getSelectedFile().getName();
     if( !new File("objdata.dat").exist() ) {
          setTestData();
          for (Order temp: orderArray());
               lmodel.addElement(temp.getOrder());)
     class Order {
          String orderid, fName, lName, street, city, state, zip;
          public Order(String order) {
               orderid = order;
          public String getOrder() {
               return orderid;
          public String getfName() {
               return fName;
          public void setfName(String fName) {
               this.fName = fName;
          public String getlName() {
               return lName;
          public void setlName(String lName) {
               this.lName = lName;
          public String getstreet() {
               return street;
          public void setstreet(String street) {
               this.street = street;
          public String getcity() {
               return city;
          public void setcity(String city) {
               this.city = city;
          public String getzip() {
               return zip;
          public void setzip(String zip) {
               this.zip = zip;
     private class TextFieldHandler implements ActionListener {
          public void actionPerformed(ActionEvent event) {
               String string = " ";
               if (event.getSource() == fieldState)
                    string = String.format("%s " + "is not correct form.", event
                              .getActionCommand());
               JOptionPane.showMessageDialog(null, string);
               // System.out.println("Please use two letter abbreviation.");
public class Main {
     public static void main(String[] args) {
          JFrame window = new orderFormGUI();
          window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          window.setVisible(true);
{code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Cross-posted:
http://forum.java.sun.com/thread.jspa?messageID=10019967

Similar Messages

  • Help....I am trying to set up iClould on my pc....the set up was complete....when I try to sign in to set up it says the Apple ID is valid but is not an iCloud account.  Please help me and tell me what I am doing wrong.

    Help....I am trying to set up iClould on my pc....the set up was complete....when I try to sign in to set up it says the Apple ID is valid but is not an iCloud account.  Please help me and tell me what I am doing wrong. Thx

    Hi DesCoop,
    You must initiallly activate iCloud from an IOS device or a Mac. You cannot inititally activated from a PC.
    Sorry.
    GB

  • I just want to ask if there is any way i can fix my ipod touch 4G from watar damage and i dont think that a larg amount of water have entered and the ipod isnt working at all and i tried charging it but it didnt work so please help me, and thankyou.

    I just want to ask if there is any way i can fix my ipod touch 4G from watar damage and i dont think that a larg amount of water have entered and the ipod isnt working at all and i tried charging it but it didnt work so please help me, and thankyou.

    Probably dead if you have tried to charge it.
    You should never try to charge or turn on a wet electronic device.
    You should let it dry for  a week or so, then try.

  • HT5312 I forget answer to my qustion with rescue email adrees please help me and send the answer to my main mail. Thank you very much

    I forget answer to my qustion with rescue email adrees please help me and send the answer to my main mail. Thank you very much

    We are fellow users here on these forums, you're not talking to iTunes Support.
    If you don't have access to your rescue email account, or you don't have one on your iTunes account, then you will need to contact iTunes Support / Apple to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699
    When they've been reset you can then use the steps half-way down this page to add/change a rescue email address for potential future use : http://support.apple.com/kb/HT5312

  • I lost my iPhone 3 days ago.. it wasn't connet to internet and I don't know how find it without the connection.. please help me and give me some advices!!

    I lost my iPhone 3 days ago.. it wasn't connet to internet and I don't know how find it without the connection.. please help me and give me some advices!!

    Change your passwords.

  • I need to by apps but it keeps asking for my security questions ;/ but  forgot the answers to my security questions and the security/rescue email too (i dont have USA number to call please help me and send my rest to my email

    I need to by apps but it keeps asking for my security questions ;/ but  forgot the answers to my security questions and the security/rescue email too (i dont have USA number to call please help me and send my rest to my email

    You need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
    (115668)

  • Hi,my ICloude is locked and canot use my Phone. Please, help me and answer me. Mira

    Hi, my name is Mira Ćenan. I from Zagreb,Croatia.
    My ICloude is locked and canot use my Phone. Please help me and answer me.
    Thank you!
    Mira

    Only the person who initiated the Activation Lock can remove it. Contact the seller/
    previous owner for assistance. There is no workaround for Activation Lock.

  • Please help! Invalid node structure and invalid record count

    My MacBook Pro is about 6.5 years old. I upgraded to Snow Leopard 2 years ago and added RAM at the same time. My first problem ever occurred three days ago when my computer got super sluggish, I restarted and got the gray screen with apple and spinning wheel...no boot up. I ran disk utility from the snow leopard install disk and found "invalid node structure" and "invalid record count". After reading on here what to do...try to repair the disk and so on with no success I went out and bought Disk Warrior. Got home expecting to fix everything and Disc Warrior won't boot...I just get a file with a question mark and the disc is ejected. I tried erasing the hard drive but was only able to use the "don't erase data" option. Then I tried to reinstall Snow Leopard with no luck. Now I am stuck. Any ideas? 
    One thing to note is I am to the point of not caring about the files on the hard drive, I was a dummy and never backed them up...lesson learned!  I just want my computer back without having to spend $1000+ for a new one. Then again I am always willing to do that too as a last resort.
    PLEASE HELP!

    When you contact Alsoft, make sure you let them know that you are using Snow Leopard (10.6.8).
    Try the following in the meantime -
    Disconnect all peripherals from your computer.
    Boot from your install disc & run Repair Disk from the utility menu. To use the Install Mac OS X disc, insert the disc, and restart your computer while holding down the C key as it starts up.
    Select your language.
    Once on the desktop, select Utility in the menu bar.
    Select Disk Utility.
    Select the disk or volume in the list of disks and volumes, and then click First Aid.
    Click Repair Disk.
    Restart your computer when done.
    Repair permissions after you reach the desktop-http://support.apple.com/kb/HT2963 and restart your computer.
    Try DiskWarrarior again if it's combatible with the os system.
    YOu cannot reformat until you get your issue corrected.

  • PLEASE HELP ME AND SEND DATA FROM CORRUPTED HARD DICS... ITS VERY IMPORTANT PLS PLS PLS

     Dear Sir,
    I had purchased laptop “pavalion DV4/WR717PA” on 25th august 2010 from  LAPTOP WORLD ,BHILAI, Dist- DURG. My system hard drive got corrupted as stated by the service centre people. They had given 15 days time limit to replace it. The problem is that my all documents, study material and presentation have been with the corrupted HARD DICS. Your service centre engineer is telling that system is not detecting HARD DISC.
    AND NO RECOVERY DVD IS GIVEN TO ME AT THE TIME OF PURCHASING LAPTOP; EVEN THEY DON’T INFORM ME THAT SUCH CD IS PROVIDED BY COMPANY…
    I request to you to please get my data’s with that HARD DISC as my examinations are starting from 2nd week of June. I am helpless without that study materials’ had worked very hard on the documents and presentations. Please get me those data’s any how…. Other wise I am unable to pass this year.
    I had very much on faith your company’s laptop had purchased hour’s company laptop in spite of many lo-cost laptop present in the market.
    Now I am seriously disappointed on hearing from your qualified engineers that they can not get my data back, and Telling that laptop is within the warranty period and we can only replace HARD DISC.
    Isn’t useless to purchase products of your company by paying high amount. Don’t let us to loose our faith on your international brand company….
    Please don’t be like cheap businessmen…and telling that laptop is within the warranty period and we can only replace HARD DISC.
    Don’t you have any engineers who can recover data stored in the DISC.Please understand the seriousness of the matter
     But within purchase of few months a fatal problem occurred. Sir what to do if there is no means of recovering data from your system… It is the failure of your product is going to spoil my one acedimic year…
    I request you to please do some thing to get me out of this situation.
     Please recover data and send me the data stored to my mail ID or a send in a DVD to my address.
     I am sending the details of system and hard disc to you. As corrupted hard disc is send to your company as told by the service center engineers to us. Please follow-up the HARD DISC. I am sending all details related to my system..
    Please don’t disappoint me, I know that you people can definitely do it… human values are also important along with business …
    With regards
    Priyanka
    Details
    Model No: Pavilion DV4/WR717PA
    Serial No: {Removed for privacy}
    CASE ID: 4629610593
    Hard disc No: 2BAZBCL83YMDGX
    Optical Drive: 7AWPNOLVBY
    Cartage: 6AQEFO5BY9W FDD-5A
    Date of purchase: 25th August 2010
    Dealer: “LAPTOP WORLD”, Supela, Bhilai, District DURG (CHATTISGARH)
    {Personal Information Removed}

    Welcome to the HP Consumer Support Community. This is a peer-to-peer community for customers to connect and share solutions regarding their HP products. If you have additional or direct feedback for HP about their products or services, please use the link below.
    http://welcome.hp.com/country/us/en/wwcontact_us.html
    If you have other questions and concerns about using the forum, please feel free to send me a private message.
    Thank you.
    Clicking the "Kudos star" to the left is a great way to say thanks!
    When your problem has been solved, accept the solution by clicking the "Accept as Solution" button to help other members in the future!
    Rules of Participation

  • Please help: RMI and Swing/AWT issue

    Hi guys, I've been having a lot of trouble trying to get a GUI application to work with RMI. I'd appreciate any help. Here's the story:
    I wrote a Java application and its GUI using Netbeans. In a nutshell, the application is about performing searches. I am now at the point where I need exterior programs to use my application's search capabilities, thus needing RMI. Such exterior programs are to call methods currently implemented in my application.
    I implemented RMI, and got the client --> server communication working. However, the GUI just breaks. It starts outputting exceptions, gets delayed, doesn't update properly, some parts of it stop working.... basically hysterical behavior.
    Now take a look at this line within my server class:
    Naming.rebind("SearchProgram", mySearchProgram);
    If I take it out, RMI obviously does not work... but the application and its GUI work flawlessly. If I put it in, the RMI calls work, but the GUI's above symptoms occur again. Among the symptoms are null pointer exceptions which all look similar, are related to "AWT-EventQueue-0", and keep ocurring. Here's just snippet of the errors outputted:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at javax.swing.plaf.metal.MetalScrollBarUI.getPreferredSize(MetalScrollBarUI.java:102)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1615)
    at javax.swing.JScrollBar.getMinimumSize(JScrollBar.java:704)
    at javax.swing.ScrollPaneLayout.minimumLayoutSize(ScrollPaneLayout.java:624)
    at java.awt.Container.minimumSize(Container.java:1598)
    at java.awt.Container.getMinimumSize(Container.java:1583)
    at javax.swing.JComponent.getMinimumSize(JComponent.java:1697)
    at java.awt.BorderLayout.minimumLayoutSize(BorderLayout.java:634)
    at java.awt.Container.minimumSize(Container.java:1598)
    at java.awt.Container.getMinimumSize(Container.java:1583)
    at javax.swing.JComponent.getMinimumSize(JComponent.java:1697)
    at java.awt.BorderLayout.minimumLayoutSize(BorderLayout.java:634)
    at java.awt.Container.minimumSize(Container.java:1598)
    at java.awt.Container.getMinimumSize(Container.java:1583)
    at javax.swing.JComponent.getMinimumSize(JComponent.java:1697)
    at javax.swing.BoxLayout.checkRequests(BoxLayout.java:433)
    at javax.swing.BoxLayout.layoutContainer(BoxLayout.java:375)
    at java.awt.Container.layout(Container.java:1401)
    at java.awt.Container.doLayout(Container.java:1390)
    at java.awt.Container.validateTree(Container.java:1473)
    at java.awt.Container.validateTree(Container.java:1480)
    at java.awt.Container.validateTree(Container.java:1480)
    at java.awt.Container.validateTree(Container.java:1480)
    at java.awt.Container.validateTree(Container.java:1480)
    at java.awt.Container.validate(Container.java:1448)
    at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:379)
    at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:113)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at javax.swing.plaf.basic.BasicMenuItemUI.getPreferredMenuItemSize(BasicMenuItemUI.java:400)
    at javax.swing.plaf.basic.BasicMenuItemUI.getPreferredSize(BasicMenuItemUI.java:310)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1615)
    at javax.swing.BoxLayout.checkRequests(BoxLayout.java:434)
    at javax.swing.BoxLayout.preferredLayoutSize(BoxLayout.java:251)
    at javax.swing.plaf.basic.DefaultMenuLayout.preferredLayoutSize(DefaultMenuLayout.java:38)
    at java.awt.Container.preferredSize(Container.java:1558)
    at java.awt.Container.getPreferredSize(Container.java:1543)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1617)
    at javax.swing.JRootPane$RootLayout.layoutContainer(JRootPane.java:910)
    at java.awt.Container.layout(Container.java:1401)
    at java.awt.Container.doLayout(Container.java:1390)
    at java.awt.Container.validateTree(Container.java:1473)
    at java.awt.Container.validate(Container.java:1448)
    at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:379)
    at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:113)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    There are no complaints about anything within my code, it's all GUI related whenever I make a bind() or rebind() call.
    Again, any help here would be great... cause this one's just beating me.
    Thanks!

    Maybe you want to change that worker thread to
    not do RMI but anything else (dummy data) to see if it really is RMI, I doubt it, I think you are updating some structures that have to do with swing GUI and hence you will hang.
    Just check this out.

  • Urgent! Need help in deciding data structure to use

    Hi all,
    I need to implement a restaurant system by which a customer can make a reservation.
    I was wondering whether vector would be able to be store such an object, The thing is I don't want a complex data structure. just sumthin simple cos i hardly have anytime left to my submission. sighz...
    The thing is I need to able to search based on 2 properties of an object. Eg. I need to search for a reservation based on the customer name and the date he reserved a table.
    But I am totally clueless how to search thru a vector based on 2 properties of the object... Would really appreciate some help. Like an example how to so so based on my program. Feelin so lost...This is all I have so far:
    class AddReservation
         static BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
         //Main Method
         public static void main (String[]args)throws IOException
              String custName, comments;
              int covers, date, startTime, endTime;
              int count = 0;
              //User can only add one reservation at a time
              do
                   //Create a new reservation
                   Reservation oneReservation=new Reservation();                         
                   System.out.println("Please enter customer's name:");
                   System.out.flush();
                   custName = stdin.readLine();
                   oneReservation.setcustName(custName);
                   System.out.println("Please enter number of covers:");
                   System.out.flush();
                   covers = Integer.parseInt(stdin.readLine());
                   oneReservation.setCovers(covers);
                   System.out.println("Please enter date:");
                   System.out.flush();
                   date = Integer.parseInt(stdin.readLine());
                   oneReservation.setDate(date);
                   System.out.println("Please enter start time:");
                   System.out.flush();
                   startTime = Integer.parseInt(stdin.readLine());
                   oneReservation.setstartTime(startTime);
                   System.out.println("Please enter end time:");
                   System.out.flush();
                   endTime = Integer.parseInt(stdin.readLine());
                   oneReservation.setendTime(endTime);
                   System.out.println("Please enter comments, if any:");
                   System.out.flush();
                   comments = stdin.readLine();
                   oneReservation.setComments(comments);
                   count++;
              while (count<1);
              class Reservation
              private Reservation oneReservation;
              private String custName, comments;
              private int covers, startTime, endTime, date;
              //Default constructor
              public Reservation()
              public Reservation(String custName, int covers, int date, int startTime, int endTime, String comments)
                   this.custName=custName;
                   this.covers=covers;
                   this.date=date;
                   this.startTime=startTime;
                   this.endTime=endTime;
                   this.comments=comments;
              //Setter methods
              public void setcustName(String custName)
                   this.custName=custName;
              public void setCovers(int covers)
                   this.covers=covers;;
              public void setDate(int date)
                   this.date=date;
              public void setstartTime(int startTime)
                   this.startTime=startTime;
              public void setendTime(int endTime)
                   this.endTime=endTime;
              public void setComments(String comments)
                   this.comments=comments;
              //Getter methods
              public String getcustName()
                   return custName;
              public int getCovers()
                   return covers;
              public int getDate()
                   return date;
              public int getstartTime()
                   return startTime;
              public int getendTime()
                   return endTime;
              public String getComments()
                   return comments;
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    class searchBooking
         static BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
         public static void main (String[]args)throws IOException
              int choice, date, startTime;
              String custName;
                   //Search Menu
                   System.out.println("Search By: ");
                   System.out.println("1. Date");
                   System.out.println("2. Name of Customer");
                   System.out.println("3. Date & Name of Customer");
                   System.out.println("4. Date & Start time of reservation");
                   System.out.println("5. Date, Name of customer & Start time of reservation");
                   System.out.println("Please make a selection: ");          
                   //User keys in choice
                   System.out.flush();
                   choice = Integer.parseInt(stdin.readLine());
                   if (choice==1)
                        System.out.println("Please key in Date (DDMMYY):");
                        System.out.flush();
                        date = Integer.parseInt(stdin.readLine());
                   else if (choice==2)
                             System.out.println("Please key in Name of Customer:");
                             System.out.flush();
                             custName = stdin.readLine();
                   else if (choice==3)
                             System.out.println("Please key in Date (DDMMYY):");
                             System.out.flush();
                             date = Integer.parseInt(stdin.readLine());
                             System.out.println("Please key in Name of Customer:");
                             System.out.flush();
                             custName = stdin.readLine();
                   else if (choice==4)
                             System.out.println("Please key in Date (DDMMYY):");
                             System.out.flush();
                             date = Integer.parseInt(stdin.readLine());
                             System.out.println("Please key in Start time:");
                             System.out.flush();
                             startTime = Integer.parseInt(stdin.readLine());
                   else if (choice==5)
                             System.out.println("Please key in Date (DDMMYY):");
                             System.out.flush();
                             date = Integer.parseInt(stdin.readLine());
                             System.out.println("Please key in Name of Customer:");
                             System.out.flush();
                             custName = stdin.readLine();
                             System.out.println("Please key in Start time:");
                             System.out.flush();
                             startTime = Integer.parseInt(stdin.readLine());
                        }

    Please stop calling your questions urgent. Everybody's question is urgent to them. Nobody's are urgent to the people who are going to answer them. Calling your questions urgent suggests that you think they are more important than others' (They're not.) and will only serve to irritate those who would help you. It won't get your questions answered any sooner.

  • Please help me on LIS structure

    Hi all,
    I am using SAP 4.0b.
    Actually I began to implemented some customized LIS (Logistic Info Structure).
    I want a LIS that contain last date of every movement type every year plus the material document and item and year.
    I create my own info structure S942. Here is the step and the problem issue :
    1. I create Field Catalog (ZGRD)for grouping application  
       41 (logsitic general), the field are :
       MCMSEG MATNR
       MCMSEG BWART
    2. I create my iwn LIS S942 application 41 (logistic
       general)
       a. I choose the characteric gtom ZGRD above and select
          MCMSEG MATNR and MCMSEG BWART
       b. I choose my key figure.
          <b>Here is the issue arise. I found posting date of
          the document, but i can't find the material doc no,
          material doc year and matereial doc item which i
          need.</b>
    Please help me regading this issue.
    Any help or opinion is very appreciated.
    Best regards,
    harry Poernomo

    Please Help me hpw to include material document no and item as key figure.
    Thank

  • Please Help : GUI component

    My plan is to create a GUI based page-editor(html) for text(bold,italic,underline etc..), images(not creation of image, just insert) and some more basic component with limited functionalities. This contains drag&drop option also.
    Hope Swing will be the best solution for this.
    Can anybody please help by providing any useful information for this. No problem even if the information you have is very basic level.
    Thanks in advance

    Yes swing is a better idea than AWT, build a class for each type of object you want to put on the page(JLabels will be a good solution for text and images).
    If you just want to move the object around the page you don't need to use DAD, implementing mousedrag will do the job.
    Noah

  • How can I set the Lock Model and data structure ?

    Hi ,
    I just have two questions about JE:
    1) Is there some method for me to set the lock mode level , such as record lock, page lock and database lock in JE?
    2) I learned that there are Btree and Hash,etc , data structures , How can I set the data structure when using JE ?
    Thanks in advance !
    Chris

    I think you're confusing our DB (C-based product) with JE. JE does not have lock mode levels, page locks (it does not have pages), or database locks. JE only has the BTREE method, it does not have the HASH method. For JE, please be sure to reference the JE doc page:
    http://www.oracle.com/technology/documentation/berkeley-db/je/index.html
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • TS3991 Please help -- my iCal data has disappeared from iCloud website!

    Hi -- I just opened iCal via the iCloud website on my MacBook Air.  My calendar data appeared for a flash, then disappeared -- now almost ALL of my calendar data is completely gone from the iCloud website.  I checked the calendar app on my iPhone 4 and the data is still there, so I turned on Airplane Mode on my phone hoping the blank calendar wouldn't sync to my phone that way.  My contacts seem to still be there.
    Please help -- where did the data go, and how can I get it back onto the iCloud website?  Thanks in advance!

    Thank you.  You may have been right about the server glitch.  After hours, literally, on the phone with Support trying to load the calendar from my phone, and finally giving up, my calendar on the website was magically restored 24 hours later. 
    I'm guessing I'm not the only one this happened to, and that they restored to an earlier version for me and whomever else's data was lost.  Pretty scary, actually -- and annoying! 
    Thanks again for your help.

Maybe you are looking for

  • ERROR in SAP System Installation

    Hi gurus!! We are trying to install a SRM system (EBP4.0) into existing database (oracle 9.2) -  MCOD mode - but when we run the installation the process terminates with the next error in sapinst.log ERROR 2008-08-29 11:16:50 CJS-00084  SQL Statement

  • TS1702 Since downloading to ios7 I cannot install or update any apps on my ipad.  Does anyone have a solution?

    After updating to ios7 on my ipad, I can't install any new apps or update any of my already installed apps. Does anyone have a solution?

  • Detecting the current tab page

    Hello All, I am working on a task for our current project which requires that I correctly identify the current tab page selected on the user's page. Toward that, I was passed some information about the function: wwpob_api_page function get_selected_t

  • Installing CS5.5 on second computer

    Hello, I'm having problems setting up my adobe creative suite 5.5 design premium on my hp laptop. I downloaded it and installed it a month or so ago but the other day when I went to use illustrator, a box popped up and it said that my trial period wa

  • [svn:bz-trunk] 5038: Merge change 5036 from BlazeDS 3.x to BlazeDS trunk.

    Revision: 5038 Author: [email protected] Date: 2009-02-23 08:26:24 -0800 (Mon, 23 Feb 2009) Log Message: Merge change 5036 from BlazeDS 3.x to BlazeDS trunk. Modified Paths: blazeds/trunk/modules/core/src/flex/messaging/endpoints/AbstractEndpoint.jav