Results 1 to 2 of 2
  1. #1
    eddy001 is offline Member
    Join Date
    Jan 2008
    Posts
    1
    Rep Power
    0

    Default Display items in the JCombo Box

    Hi all,

    I have to create a combo box in which I want to seperate one of items with the others through a line separator (similar to line separators which one sees in the various tab menus).


    Well right now I've just no idea of how it can be done. So can someone just give me a clue of how it can be done?

    Thanks:)

  2. #2
    Mark_Petrov is offline Member
    Join Date
    Jan 2008
    Posts
    3
    Rep Power
    0

    Default

    /* Create a combo box and a descriptive label */
    fontStylePrompt = new JLabel("Select a font for your resume: ");
    fontStylePrompt.setAlignmentX(JLabel.CENTER_ALIGNM ENT);
    content.add(fontStylePrompt);

    String[] fonts = {"Times New Roman", "Ariel"}
    fontStyle = new JComboBox(fonts);
    fontStyle.setAlignmentX(JComboBox.CENTER_ALIGNMENT );
    fontStyle.setSelectIndex(0);
    fontStyle.addActionListener(this);
    content.add(fontStyle);

    here a small snipet of code for the JComboBox that will help you

Similar Threads

  1. GUI components not display
    By Eranga in forum AWT / Swing
    Replies: 2
    Last Post: 03-12-2008, 03:16 AM
  2. Replies: 0
    Last Post: 01-04-2008, 10:34 AM
  3. Replies: 2
    Last Post: 12-05-2007, 02:19 PM
  4. Adding items to a jComboBox
    By tronovan in forum New To Java
    Replies: 0
    Last Post: 08-08-2007, 09:48 AM
  5. hyperlinks from menu items?
    By asterope118 in forum New To Java
    Replies: 1
    Last Post: 07-16-2007, 02:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •