How can i repaint my frame after adding new component

Discussion in 'Java' started by crazybird_2005, Jul 15, 2005.

  1. i want that as choose user option from the combobox my frame shows
    different component with respect to the option chosen by the user in
    the combobox
     
    crazybird_2005, Jul 15, 2005
    #1
    1. Advertising

  2. On 15 Jul 2005 02:09:46 -0700, crazybird_2005 wrote:

    > i want that as choose user option from the combobox my frame shows
    > different component with respect to the option chosen by the user in
    > the combobox


    Probably a CardLayout is what best fits here.
    <http://java.sun.com/j2se/1.5.0/docs/api/java/awt/CardLayout.html>

    Note that the best group for GUI questions is.
    <http://www.physci.org/codes/javafaq.jsp#cljg>

    And while I have your attention, and since you are
    posting from one of the more popular web interfaces..
    <http://www.physci.org/codes/javafaq.jsp#google>

    HTH

    --
    Andrew Thompson
    physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
    You Can't Prove It Won't Happen
     
    Andrew Thompson, Jul 15, 2005
    #2
    1. Advertising

  3. Have you tried using Component.repaint()?
    K
    "crazybird_2005" <> wrote in message
    news:...
    >i want that as choose user option from the combobox my frame shows
    > different component with respect to the option chosen by the user in
    > the combobox
    >
     
    Kurt M Peters, Jul 15, 2005
    #3
  4. i take panel i which i add combobox containing all batches running in
    the center
    As user choose batch in which he/she want to associate candidate
    already registered for the course for which that batch was announce.

    for that i registered that panel as ActionListener for that combobox

    on selecting option from this combobox it trigerred the action command
    where i call repaint() method in the paintComponent methid i try to add
    the label component and the listbox showing name of all the candidates
    enrolled for that course.
    but it don't work
     
    crazybird_2005, Jul 15, 2005
    #4
  5. On 15 Jul 2005 07:03:05 -0700, crazybird_2005 wrote:

    > i take panel i which i add combobox ..


    Let the code do the talking.
    <http://www.physci.org/codes/sscce.jsp>

    > but it don't work


    Lazy, is it?
    <http://www.physci.org/codes/javafaq.jsp#specific>
    <http://www.physci.org/codes/javafaq.jsp#exact>

    --
    Andrew Thompson
    physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
    LOADING....
     
    Andrew Thompson, Jul 16, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. MaciekL
    Replies:
    1
    Views:
    892
    supercalifragilisticexpialadiamaticonormalizeringe
    Aug 5, 2011
  2. MaciekL
    Replies:
    2
    Views:
    1,781
    Ian Shef
    Aug 5, 2011
  3. Miguel Minora
    Replies:
    1
    Views:
    158
    Miguel Minora
    Jan 11, 2005
  4. Jim Cobban
    Replies:
    0
    Views:
    127
    Jim Cobban
    Jul 31, 2005
  5. Maciej Labanowicz
    Replies:
    8
    Views:
    490
Loading...

Share This Page