Jcombobox Main  populating JcomboboxSub in JPanel form

Hi,
I have a problem and am hoping someone can help me out.
My main problem is where I have a program that where the user
Selects the Make of a Car
"Choose Make", "Chevrolet", "Crysler", "Ford", "Lexus", "Toyota"
Once a choice is made a 2nd jcombobox will populate pending on the choose of the 1st combobox choice.
if Chevrolet "Choose Model", "Tahoe", "Suburban", "Cavalier", " Impala"
if Crysler "Choose Model", "LaBaron", "PTCruiser", "Concord", "300"
if Ford "Choose Model", "F150", "Bronco", "Taurus", "Explorer"
if Lexus               "Choose Model", "L200", "L300", "L400", "L500"          
if Toyota "Choose Model", "Camary", "Celica", "Tacoma", "4Runner"
I am using NetBeans Swing GUI Forms, JPanel form and I am somewhat of a newbee.
I have the 2 jcomboboxs on there with the item1,item2, item3, item4 as there strings.
I know there is a connection button in design as to where the Combobox will have a relationship,
but I am not sure of what to pick for my options or how to code it.
I am thinking an actionPreformed but am not sure and I can't figure it out.
Can someone tell me how to do this in the Design Mode?
Thank you in advance,
Shotgun

This is not a NetBeans forum.
Learn how to write your own code and don't depend on an IDE.
You can search the forum for my "Combo Box Two" (without the spaces) example.

Similar Messages

  • Cancelled contract lines are populating in the SR form's subject tab when clicking on 'Get Contracts' button

    Cancelled contract lines are populating in the SR form's subject tab when clicking on 'Get Contracts' button. But user says, it should not be populated. What could be the reason? Please suggest.
    I have told the user :
    "In the case of a renewed contract, if the service request is logged during the effectivity of the original contract (which is now Expired), the original contract will be retrieved. If the service request is logged during the effectivity of the renewal contract then only the renewal contract will be retrieved.
      Contract Entitlement on Subject tab is based on Contract Start and End dates. All the contracts i.e. expired, active, cancelled will appear until the end date. As we can see the contract ES-10165 is end dated on 09-DEC-2014, hence it will appear on the subject tab as per the functionality."
    But the User is saying:
    "Contract coverage is clear to be based on dates, and that is quite clear to me as well… the problem comes with the different statuses.
    A SR can be associated to an “EXPIRED” contract line because the SR creation date could be falling between coverage line start and end dates, but can never be related to a “CANCELLED” line.
    This “CANCELLED” status means that the line is not valid for the contract, so if it is not valid for a contract, it is not valid for referencing a job…and this is only creating wrong costs associations."

    Hi Sudhakar,
    Drop inline message components for each of the textFields and the textArea and then run the application. You could also use a message list component but inline message components for each of the input components would give you a clear idea if any errors are occuring. In case any such errors are indeed occuring then the situation can be analysed further.
    Hope this helps
    Cheers
    Giri :-)

  • How can i save the data in a jpanel form to a .txt document

    how can i save the data in a jpanel form to a text file using parse function,this should happen when i click a save button .
    please help me..

    each time when i fill the form and click save button ,all the data in the form should be written to a text file and each time when i repeat it should append to the old data in the text file.the elements in the form should be seperated by pipe delimeter.
    thanks for your patience..

  • JTable with JPanel form as cell renderer/editor

    I have a JTable that uses a custom cell editor/renderer. The cell editor/renderer is a JPanel form with labels and text panes. As the user edits the information, I adjust the table row height (setRowHeight) and the JPanel layout manager updates the layout on the cell editor. This all seems to work fine. However, when the user exists the cell and the cell renderer is shown, it has the correct new row height but has not been correctly layed-out for the new row height. How do I force my cell renderer to be re-layout after the editor closes?

    That does not seem to work. I have done the following:
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int r, int c)
    this.table = (EditorTable) table;
    row = r;
    column = c;
    if (isSelected)
    setBackground (Preferences.selectedRowBgColor);
    else
    setBackground (formBg);
    // constructs the panel components
    setCellValue (value);
    revalidate();
    return (this);

  • Report does not show the main section while calling from forms 6i

    Hi
    I am running report from report from forms 6i but is does not show the data in main section, where as the data in the header section is ok.
    But when i run the same report independantly from report builder it show the both header and main section with relevent data.
    pl solve the matter
    thanks in advance

    can you tell me more about this, you might check if you are using different users when you call this report or if the user has all privileges to see all tables in this report

  • Error in populating table data through forms

    I had one SIM REPLACEMENT Form which has a base block table PPBS_SIM_CHANGE.
    Once all the entires are entered the table gets populated.
    But some times it seen that the base table does not get populated.Also the form does not gives any error.Pl help me to find out the error.
    In the Save button the following code is written
    IF :SYSTEM.FORM_STATUS IN ('NEW','CHANGED') THEN
    commit;
    if not form_success then
    message ('Transaction Failed...');
    else
    message('Transaction Successfully Completed..');
    end if;
    END IF;

    Why do you create a Save button in the first place? Forms already has its own Save botton.

  • Expected value type: end-of-string infopath configuing the main submit button on the form.

    Hi Everyone,
    so I have run into this very odd problem. When I am trying to configure my main submit for my infopath 2010 form, and it says File Name, I put in concat(field 1, field 2, field 3), and when the form submits, I get the following as a name for my form: field
    1, field 2, field 3, exactly like that. so I went back into the main submit and typed concat( and then used the function button, which brought up the list of controls to choose from, so I choose field 1, field 2, field 3 and when I hit ok, I keep getting this
    error:
    Expected value type: end-of-string
    Actual value: ,
    my:secReqMetaData/my:field 1-->,<-- my:secReqMetaData/my:field 2,my:secReqMetaData/my:field 3
    does anyone have any idea why this is happening?
    Best regards, Mike

    Thanks for sharing the answer here, it would be helpful for others with similar issue.
    Qiao Wei
    TechNet Community Support

  • JComboBox is not visible on JPanel

    I have a class that extends JPanel. Within this class I have added several different components; JLabels, JTextFields, JButtons and a JComboBox.
    All of the added components are visible and working except for the JComboBox. I can see the white background of the box and the popup and its list when I click on the area where the JComboBox is located, but I cannot see the selected text in the box. This seems strange since all the other components surrounding the JComboBox display correctly.
    The background is set to white and the foreground is set to black. It has three options in the popup which are displayed using the foreground color, as it should. When I select an option from the popup, it seems to be working because the next time I display the popup, that selection is highlighted. But the selected text never shows in the box.
    If I create a JComboBox in a JPanel, not an extended class, everything seems to work correctly. I can select from the popup and the selection appears in the box.
    Could you please give me some suggestions as to how to make the selected text in the JComboBox visible?
    Thanks
    Bob

    My layout manager is set to null. I don't think that there is anything obscuring it because the backgroud is visible. The only thing that I can't see it the selected text and the combo box down arrow. I am using VisualCafe to generate this code.
    The extended class is loaded from the following class:
    public class TheSchedule extends javax.swing.JFrame
    using the following code:
         void JButtonGenTimeUnits_actionPerformed(java.awt.event.ActionEvent event)
              JPanelMainPanel.add(new TimeUnitDefinition((Frame)this));
              JPanelMainPanel.repaint();
    The actual code of the TimeUnitDefinition is as follows:
    package com.klawuhn.schedule;
    import javax.swing.*;
    import java.beans.*;
    import java.awt.*;
    import com.symantec.itools.javax.swing.models.StringComboBoxModel;
    import symantec.itools.awt.util.Calendar;
    import com.symantec.itools.javax.swing.borders.LineBorder;
    public class TimeUnitDefinition extends javax.swing.JPanel {
    private Frame parentFrame = null;
         public TimeUnitDefinition(Frame parentFrame)
         this.parentFrame = parentFrame; // Needed when displaying the calendars
              //{{INIT_CONTROLS
              setAlignmentY(1.0F);
              setAlignmentX(1.0F);
              setOpaque(false);
              setLayout(null);
              setSize(457,283);
              JLabelStartDate.setText("Start Date:");
              add(JLabelStartDate);
              JLabelStartDate.setBounds(12,12,156,24);
              JTextFieldStartDate.setDisabledTextColor(java.awt.Color.white);
              JTextFieldStartDate.setToolTipText("This is the date to start generating time units.");
              JTextFieldStartDate.setEditable(false);
              add(JTextFieldStartDate);
              JTextFieldStartDate.setBackground(java.awt.Color.white);
              JTextFieldStartDate.setBounds(168,12,216,24);
              JButtonCalendar1.setText("-");
              JButtonCalendar1.setActionCommand("-");
              add(JButtonCalendar1);
              JButtonCalendar1.setBounds(384,12,24,24);
              JLabelEndDate.setText("End Date:");
              add(JLabelEndDate);
              JLabelEndDate.setBackground(java.awt.Color.cyan);
              JLabelEndDate.setBounds(12,48,156,24);
              JTextFieldEndDate.setDisabledTextColor(java.awt.Color.white);
              JTextFieldEndDate.setToolTipText("This is the date to start generating time units.");
              JTextFieldEndDate.setEditable(false);
              add(JTextFieldEndDate);
              JTextFieldEndDate.setBackground(java.awt.Color.white);
              JTextFieldEndDate.setBounds(168,48,216,24);
              JButtonCalendar2.setText("-");
              JButtonCalendar2.setActionCommand("-");
              add(JButtonCalendar2);
              JButtonCalendar2.setBounds(384,48,24,24);
              JLabelStartTime.setText("Start Time:");
              add(JLabelStartTime);
              JLabelStartTime.setBounds(12,84,156,24);
              JTextFieldStartTime.setToolTipText("This is the time of day to start generating time units.");
              add(JTextFieldStartTime);
              JTextFieldStartTime.setBounds(168,84,240,24);
              JLabelEndTime.setText("End Time:");
              add(JLabelEndTime);
              JLabelEndTime.setBounds(12,120,156,24);
              JTextFieldEndTime.setToolTipText("This is the time of day to end generating time units.");
              add(JTextFieldEndTime);
              JTextFieldEndTime.setBounds(168,120,240,24);
              JLabelUnitOfMeasure.setText("Unit of Measure:");
              add(JLabelUnitOfMeasure);
              JLabelUnitOfMeasure.setBounds(12,156,156,24);
              JComboBoxUnitOfMeasure.setModel(stringComboBoxModel1);
              JComboBoxUnitOfMeasure.setToolTipText("This is the unit of measure used when generating the time units.");
              add(JComboBoxUnitOfMeasure);
              JComboBoxUnitOfMeasure.setBackground(java.awt.Color.white);
              JComboBoxUnitOfMeasure.setForeground(java.awt.Color.black);
              JComboBoxUnitOfMeasure.setBounds(168,156,240,24);
              JLabelBlockSize.setText("Block Size:");
              add(JLabelBlockSize);
              JLabelBlockSize.setBounds(12,192,156,24);
              JTextFieldBlockSize.setText("45");
              JTextFieldBlockSize.setToolTipText("This is the size of the time unit in Unit of Measures.");
              add(JTextFieldBlockSize);
              JTextFieldBlockSize.setBounds(168,192,240,24);
              JButtonSubmit.setText("Submit");
              JButtonSubmit.setActionCommand("Submit");
              JButtonSubmit.setToolTipText("This button will generate the time units.");
              add(JButtonSubmit);
              JButtonSubmit.setBounds(36,228,108,40);
              JButtonCancel.setText("Cancel");
              JButtonCancel.setActionCommand("Cancel");
              JButtonCancel.setToolTipText("This button will discard any changes.");
              add(JButtonCancel);
              JButtonCancel.setBounds(288,228,108,40);
                   String[] tempString = new String[3];
                   tempString[0] = "Days";
                   tempString[1] = "Hours";
                   tempString[2] = "Minutes";
                   stringComboBoxModel1.setItems(tempString);
              //$$ stringComboBoxModel1.move(0,288);
              JComboBoxUnitOfMeasure.setSelectedIndex(2);
              //{{REGISTER_LISTENERS
              SymAction lSymAction = new SymAction();
              JButtonSubmit.addActionListener(lSymAction);
              JButtonCalendar1.addActionListener(lSymAction);
              JButtonCalendar2.addActionListener(lSymAction);
         //{{DECLARE_CONTROLS
         javax.swing.JLabel JLabelStartDate = new javax.swing.JLabel();
         javax.swing.JTextField JTextFieldStartDate = new javax.swing.JTextField();
         javax.swing.JButton JButtonCalendar1 = new javax.swing.JButton();
         javax.swing.JLabel JLabelEndDate = new javax.swing.JLabel();
         javax.swing.JTextField JTextFieldEndDate = new javax.swing.JTextField();
         javax.swing.JButton JButtonCalendar2 = new javax.swing.JButton();
         javax.swing.JLabel JLabelStartTime = new javax.swing.JLabel();
         javax.swing.JTextField JTextFieldStartTime = new javax.swing.JTextField();
         javax.swing.JLabel JLabelEndTime = new javax.swing.JLabel();
         javax.swing.JTextField JTextFieldEndTime = new javax.swing.JTextField();
         javax.swing.JLabel JLabelUnitOfMeasure = new javax.swing.JLabel();
         javax.swing.JComboBox JComboBoxUnitOfMeasure = new javax.swing.JComboBox();
         javax.swing.JLabel JLabelBlockSize = new javax.swing.JLabel();
         javax.swing.JTextField JTextFieldBlockSize = new javax.swing.JTextField();
         javax.swing.JButton JButtonSubmit = new javax.swing.JButton();
         javax.swing.JButton JButtonCancel = new javax.swing.JButton();
         com.symantec.itools.javax.swing.models.StringComboBoxModel stringComboBoxModel1 = new com.symantec.itools.javax.swing.models.StringComboBoxModel();
         class SymAction implements java.awt.event.ActionListener
              public void actionPerformed(java.awt.event.ActionEvent event)
                   Object object = event.getSource();
                   if (object == JButtonSubmit)
                        JButtonSubmit_actionPerformed(event);
                   else if (object == JButtonCalendar1)
                        JButtonCalendar1_actionPerformed(event);
                   else if (object == JButtonCalendar2)
                        JButtonCalendar2_actionPerformed(event);
         void JButtonSubmit_actionPerformed(java.awt.event.ActionEvent event)
              System.out.println("See Submit button");
              TimeUnitCreate timeUnitCreate = new TimeUnitCreate(
              JTextFieldStartDate.getText(),
              JTextFieldEndDate.getText(),
              JTextFieldStartTime.getText(),
              JTextFieldEndTime.getText(),
              (String)JComboBoxUnitOfMeasure.getSelectedItem(),
              JTextFieldBlockSize.getText()
              timeUnitCreate.createTimeUnits();
              this.setVisible(false);
    System.out.println("Done creating Time Units.");
    // (new TimeUnitDefinition()).setVisible(true);
         void JButtonCalendar1_actionPerformed(java.awt.event.ActionEvent event)
         CalendarDialog calendarDialog = new CalendarDialog(parentFrame,"Date",true);
         calendarDialog.show();
         JTextFieldStartDate.setText(calendarDialog.getSelectedDate());
         void JButtonCalendar2_actionPerformed(java.awt.event.ActionEvent event)
         CalendarDialog calendarDialog = new CalendarDialog(parentFrame,"Date",true);
         calendarDialog.show();
         JTextFieldEndDate.setText(calendarDialog.getSelectedDate());
    }

  • Populating values in interactive form drop

    Hi,
    I have created an adobe form, in which I have to create drop down box which has to read values from simple type. for this i have created context attribute whose type is simple type, and i have draged that context attribute in adobe form, and made it to drop down list, but values r not getting populating here,
    how to poin this to simple type.

    Hi venki,
    Do 1 thing plaec a ActiveX typ eDropDown from the library tab,
    then from the Object>>Binding tab, bind that dropdown to the attribute..
    Hope this helps,
    Thanks,
    Amita

  • Pre-populated in user create form

    Hello there,
    I want to have user create form that displays some pre-populated fields in Access Manager. I have added the new fields and can see on the user create form but I want to populate these fields with the values from database or some other resource. Any idea how can this be done?
    Thanks in advance.

    There are various ways this can be done. One way is to use a back-end application to pre-populate a copy of the PDF with the data and then serve it to the user, but that is quite complex to implement. Another way would be to use parameters in the URL to do it. That can be done more easily with a script.

  • Increase main oracle window size in forms 10g

    I am creating a form in 10g. The form has a window and a canvas. I have given scroll bar for the canvas which has multiple blocks (so that a user can scroll within the multiple records) and a scroll bar for the window so that the user can scroll at the bottom of the page.
    The main oracle window which displays the messages and errors (not my forms window) is not the full size, its a little small (there is white blank space at the bottom) and I want to increase its size to full so that the users may not necessarily need to use the window scroll bar.
    Can someone please tell me how to increase its size?
    Thanks.

    Hello
    I think that others user could have problems, above all, with 'SEPARATEFRAME=TRUE'.
    Here a note from metalink:
    Note:358468.1 How to Maximize the MDI Window correctly on Web showing the Status bar?
    When you try to Maximize MDI window in to form using
    set_Window_property(FORMS_MDI_WINDOW,WINDOW_STATE,MAXIMIZE) on web,
    even though the MDI window appears as Maximized it is not actually maximized,
    also it doesnt show the status cafe.
    This issue has been explained in BUG#4944285 Known and 181100.1
    Regards

  • HELP! need help moving "main" text box in landscape form

    Hello. I am working with a table that is now in landscape. I imported it from another FrameMaker 7.2 file which was in portrait form. The table is ongoing (spills into the next page) and I need to be able to move the "main" text box that the table imported into. I am unable/unsure how to go about doing this?! I have to adjust this box because I still have headers/footers/colored border to add later on. Is it also possible to change the size of that "main" text box that automatically appears when you would first open up a blank document??
    -kt

    Hi kt,
    it's quite easy, if I understand what you want to do...
    Go to the Master Pages in the target document and either create a new masterpage - (called land2port) or alter the existing master page that is being used... You can change the size and position of the TextFlow frame... Then the save the document as a template - import your landscape table and apply the appropriate master page - voilla!
    now you will have room for your headers and footers...
    enjoy!
    David
    [signature link removed]

  • How to assign multiple categories to a webapp item that is populated from a frontend form?

    We have a webpage with a form that allow users to populate a webapp, but we also need that the user can assign multiple categories to the webapp item that is going to insert.
    The support forum told us that it is not possible to assign categories from the frontend, but only from the admin area.
    Is there any workaround to this issue? We do not want the users to access to the admin area because we need them to populate the webapp only from the web form.
    Thanks for any help on this.
    Franco

    Dont know if this will help:
    http://bcgurus.com/tutorials/dynamic-categories-for-business-catalyst-introduction

  • Populating XML file for form set

    Hi there,
    We have several forms that we need to fill out with the same information for each "case" we deal with. Its the usual stuff like names, dates and addresses.
    At present we fill out each form one at a time - very repetitive.
    I want to have a underlying xml file populate each form.
    This presents a few questions:
    1. We don't have a database to populate the underlying xml file. What would be a good way to have the user enter this xml data? In addition to entering the xml data it needs to be store in a different folder each time (there is a folder for each case) and
    the dialog box (or whatever) needs to be able to accommodate a different number of people associated with different cases. Some might have 4 people some might only have two.
    2. Then a template, which could be one big document with each form.
    These goals maybe able to be done entirely within word, but I look forward to suggestions on this!
    Regards,
    -Al

    Hi,
    Thank you for posting in the MSDN Forum.
    Since the issue is more relate to the end-user, I'd like to move it to Word IT pro forum.
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.
    Thanks for your understanding.
    Best regards
    Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Drop Down List population - Abap dynpro adobe form - type ZCI

    Hi ,
    How to create drop down list on a field. I am using ZCI type of form. (Abap dynpro adobe form - type ZCI)
    Most of the post i have seen only refers to the setting in forms but not about the settings in interface in se80 or SFP. please give me the detail steps to create drop down field and how to populate it.
    In other words is how to populate the drop down fields, where does the values come from to these fields.
    Thanks,
    Nikhil
    Edited by: NIKHILKUMAR POOJARI on Apr 3, 2009 7:28 PM

    HI Pradeep,
    Can you please tel me what i am doing worng here :
    types : begin of ty_nameid,
                  ZCARRIAGERESTRIC type ZCARRIAGERESTRICT,
                  DESCRIPTION type ZDESCRIPTION,
                END OF ty_nameid,
                tyt_nameid TYPE TABLE OF ty_nameid.
        data  : it_nameid type tyt_nameid,
                wa_nameid TYPE ty_nameid.
        DATA lo_nd_name TYPE REF TO if_wd_context_node.
        DATA lo_nd_nameid TYPE REF TO if_wd_context_node.
        DATA lo_el_nameid TYPE REF TO if_wd_context_element.
        DATA ls_nameid TYPE wd_this->element_nameid.
      navigate from <CONTEXT> to <NAME> via lead selection
        lo_nd_name = wd_context->get_child_node( name = wd_this->wdctx_name ).
      navigate from <NAME> to <NAMEID> via lead selection
        lo_nd_nameid = lo_nd_name->get_child_node( name = wd_this->wdctx_nameid ).
      @TODO handle not set lead selection
        IF lo_nd_nameid IS INITIAL.
        ENDIF.
      get element via lead selection
        lo_el_nameid = lo_nd_nameid->create_element(  ).
      @TODO handle not set lead selection
        IF lo_el_nameid IS INITIAL.
        ENDIF.
      alternative access  via index
      lo_el_nameid = lo_nd_nameid->get_element( index = 1 ).
      @TODO handle non existant child
      IF lo_el_nameid IS INITIAL.
      ENDIF.
    select * from ZCARRIAGERESTRIC INTO CORRESPONDING FIELDS OF TABLE it_nameid.
      get all declared attributes
       lo_el_nameid->set_attribute(
         EXPORTING
           Value = it_nameid
           name  = 'NAMEID' ).
    lo_nd_nameid->bind_table( it_nameid ).
    but its giving dump WebDynpro Exception: The ADS call has failed.
    i have created the Node as under
    CONTEXT
    NAME (NODE)
    NAMEID (NODE)
    ZCARR (ATTRIBUTE)
    DESCR  (ATTRIBUTE)
    DESC (ATTRIBUTE)
    I tried the second method, but that too failed. while entering the INSERT WEB DYNPRO SCRIPT it gave an error 'Error while entering script'.
    Edited by: NIKHILKUMAR POOJARI on Apr 6, 2009 11:04 AM

Maybe you are looking for