Results 1 to 13 of 13
  1. #1
    programmer_007's Avatar
    programmer_007 is offline Senior Member
    Join Date
    Aug 2009
    Posts
    125
    Rep Power
    0

    Default designing application in swing

    my application looks like simple windows notepad application
    where one menubar is there on top ..having several menus with menuitems like notepad has ,but my applicationm is not a text editor ..ok

    if i click on any of this submenu, i want respective controls or different frames to appear below that menu bar .. or center of my application window .. i dont want a separate internal frame ..coz it is chaotic .. what i want is to change my GUI without removing that menubar .. and change between mwnuitems seamlessly .. if anyone can help or have any ideas .. reply .. sandeep_soni10@yahoo.com

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    1) As mentioned in the previous thread that you posted in: use a CardLayout if you want to swap JPanels or other components based on menu actions.
    2) Please don't ask for email replies as that's not how this forum works. It is here to share questions and solutions with all.

    Best of luck.

  3. #3
    shahid0627 is offline Member
    Join Date
    Aug 2009
    Posts
    16
    Rep Power
    0

    Default

    I think cardLayout will manage the problem.
    Or you can try another way.
    Try to return the panel/frame you want to the parent panel.

  4. #4
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Perhaps you just want a TabbbedPane?

  5. #5
    programmer_007's Avatar
    programmer_007 is offline Senior Member
    Join Date
    Aug 2009
    Posts
    125
    Rep Power
    0

    Default

    it sounds cool .. i tried the demo .. it looks good .. started coding .. lets see if it satisfies the need .. but tell me a thing can i add submenus to different tabs . and is it possible that each submenu's menuitems can display different panels when clicked.. if it goes good .. i will be done with my designing ..

    Thanks .. plz reply this one.

  6. #6
    programmer_007's Avatar
    programmer_007 is offline Senior Member
    Join Date
    Aug 2009
    Posts
    125
    Rep Power
    0

    Default

    this way do not meet my needs ..coz i have submenus or menuitems in my main menus ..
    and these submenus covers whole place in individual panels of each main menus ...

    problem not solved .. suggest some other way ... night is short wen u r failing

  7. #7
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    We are back to when we started then.

    How to use CardLayout.

  8. #8
    mrmatt1111's Avatar
    mrmatt1111 is offline Senior Member
    Join Date
    Aug 2009
    Location
    San Jose, CA, USA
    Posts
    320
    Rep Power
    6

    Default

    I might be speaking swing blasphemy but:

    As an alternative to CardLayout, if you don't mind doing some/lot of extra work but get things exactly as you want them, you can try using null layout, setting the sizes and positions of the panels and setting "setVisible(...)" to hide and show things.
    My Hobby Project: LegacyClone

  9. #9
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by mrmatt1111 View Post
    I might be speaking swing blasphemy but:
    As an alternative to CardLayout, ...you can try using null layout, ...
    The last forum member who recommended this was burned at the stake. Just a friendly reminder.

    Signed: the Swing Layout Manager Compliance Committee

  10. #10
    mrmatt1111's Avatar
    mrmatt1111 is offline Senior Member
    Join Date
    Aug 2009
    Location
    San Jose, CA, USA
    Posts
    320
    Rep Power
    6

    Default

    Hahahaha. Awesome.
    My Hobby Project: LegacyClone

  11. #11
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Quote Originally Posted by mrmatt1111 View Post
    I might be speaking swing blasphemy but:

    As an alternative to CardLayout, if you don't mind doing some/lot of extra work but get things exactly as you want them, you can try using null layout, setting the sizes and positions of the panels and setting "setVisible(...)" to hide and show things.
    Alert the plebeians. A defen is on the way.

  12. #12
    programmer_007's Avatar
    programmer_007 is offline Senior Member
    Join Date
    Aug 2009
    Posts
    125
    Rep Power
    0

    Default

    wht does that mean ??

  13. #13
    programmer_007's Avatar
    programmer_007 is offline Senior Member
    Join Date
    Aug 2009
    Posts
    125
    Rep Power
    0

    Default

    anyways . after trying all stuffs the easiest way i came out with is -
    1.declare as many panels u want .2>make separate function for each panel in which setLayout as u want to place different components....after that call this function in ur actionPerformed method.. so it finally worked on 29th august 2009 ,, but my
    Net Conection was down .. so i was not able to post .. anyway cool..

Similar Threads

  1. How can we use JCalender in Java Swing Application?
    By makpandian in forum AWT / Swing
    Replies: 4
    Last Post: 03-06-2009, 09:08 AM
  2. deployment of swing application
    By makpandian in forum AWT / Swing
    Replies: 1
    Last Post: 12-26-2008, 04:08 PM
  3. Swing Application Framework
    By jurka in forum AWT / Swing
    Replies: 0
    Last Post: 10-09-2008, 06:01 PM
  4. advise on designing an ejb application
    By bobD in forum New To Java
    Replies: 0
    Last Post: 09-03-2008, 09:04 AM
  5. Replies: 2
    Last Post: 07-04-2007, 06:58 AM

Posting Permissions

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