Newbie question re NetBeans and GUI appearance

Discussion in 'Java' started by MikeB, Jan 30, 2007.

  1. MikeB

    MikeB Guest

    I apologize. I expect this is the wrong forum to ask my question and
    would appreciate a hint as to the appropriate forum to ask this
    question in.

    On the off chance that someone will answer, I will put my question
    here as well.

    I'm a student at university and we have to develop a GUI program with
    NetBeans. I have managed to complete the layout of my frame and all
    the components appear. However, the appearance is different depending
    on how I display the frame. If, while in the IDE, I click on the
    "Preview Design" icon, I see the frame rendered so that it looks
    exactly like any other windows window on my computer. If I choose to
    Run the application, I get a clunky, less nice appearance of the
    window.

    Can anyone point me to what/where I need to change things so the run-
    time window is as nice-looking as the design-time window?

    Thanks.
    Mike
     
    MikeB, Jan 30, 2007
    #1
    1. Advertising

  2. MikeB

    Ike Guest

    I think you need to set the size of the frame, and take into account
    whatever layout manager you are using. -Ike
     
    Ike, Jan 30, 2007
    #2
    1. Advertising

  3. MikeB

    Michael Guest

    On Jan 30, 10:51 am, "MikeB" <> wrote:
    > I'm a student at university and we have to develop a GUI program with
    > NetBeans. I have managed to complete the layout of my frame and all
    > the components appear. However, the appearance is different depending
    > on how I display the frame. If, while in the IDE, I click on the
    > "Preview Design" icon, I see the frame rendered so that it looks
    > exactly like any other windows window on my computer. If I choose to
    > Run the application, I get a clunky, less nice appearance of the
    > window.


    It sounds like you need to set the look and feel:
    http://java.sun.com/docs/books/tutorial/uiswing/lookandfeel/
    plaf.html
    Basically, you'll need to add code as shown to your main function (or
    some other such place). Presumably NetBeans is automatically doing
    that in Preview Design mode.

    Michael
     
    Michael, Jan 30, 2007
    #3
  4. MikeB

    MikeB Guest

    On Jan 30, 3:11 pm, "Michael" <> wrote:
    > On Jan 30, 10:51 am, "MikeB" <> wrote:
    >
    > > I'm a student at university and we have to develop a GUI program with
    > > NetBeans. I have managed to complete the layout of my frame and all
    > > the components appear. However, the appearance is different depending
    > > on how I display the frame. If, while in the IDE, I click on the
    > > "Preview Design" icon, I see the frame rendered so that it looks
    > > exactly like any other windows window on my computer. If I choose to
    > > Run the application, I get a clunky, less nice appearance of the
    > > window.

    >
    > It sounds like you need to set the look and feel:
    > http://java.sun.com/docs/books/tutorial/uiswing/lookandfeel/
    > plaf.html
    > Basically, you'll need to add code as shown to your main function (or
    > some other such place). Presumably NetBeans is automatically doing
    > that in Preview Design mode.
    >
    > Michael


    That was it! Thank you so much. It was a piece of cake to add it and
    now my app looks the way I expect it to look.
     
    MikeB, Jan 30, 2007
    #4
    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. Pimousse
    Replies:
    2
    Views:
    3,699
    Roedy Green
    Apr 21, 2004
  2. Ilias Lazaridis
    Replies:
    0
    Views:
    938
    Ilias Lazaridis
    Dec 12, 2004
  3. Replies:
    7
    Views:
    1,198
    Chris Smith
    May 9, 2006
  4. Thomas G. Marshall
    Replies:
    2
    Views:
    856
    Thomas G. Marshall
    Oct 16, 2006
  5. maria
    Replies:
    10
    Views:
    645
    Pete Becker
    Jan 11, 2008
Loading...

Share This Page