Results 1 to 2 of 2
  1. #1
    preethidv is offline Member
    Join Date
    Aug 2009
    Posts
    2
    Rep Power
    0

    Default Redrawing the grid bag layout

    Hi All,

    I have a requirement in which I want to redraw a gridbaglayout panel based on a radio button selection. Can someone suggest me how to achieve this? Initially, the screen will look like this -

    <Radio button 1>
    <Radio button 2>
    <Radio button 3>

    On selection of radio button 2, I should show -
    <Radio button 1>
    <Radio button 2>
    <JPanel 1>
    <Radio button 3>

    On selection of radio button 3, I should show -
    <Radio button 1>
    <Radio button 2>
    <Radio button 3>
    <JPanel 2>

    On selection of radio button 1, I should show -
    <Radio button 1>
    <Radio button 2>
    <Radio button 3>


    What is the best way to achieve this? I was thinking of card layout for the entire screen (and switch between 3 UIs based on button selection), but that requires me to maintain 3 different instances of the 3 radio buttons (since the button click can happen in any order). Can someone please suggest me better method?


    Thanks,
    Preethi

  2. #2
    curmudgeon is offline Senior Member
    Join Date
    May 2010
    Posts
    436
    Rep Power
    5

    Default

    Can you do one or both of these recommendations?

    1) Post screen shots showing exactly the effect that you are trying to achieve.
    2) Post a very small compilable program that demonstrates your problem, a program that we can compile and run without any dependencies.

    Also, have you tried a simple setVisible(true/false)? for the JPanel?

Similar Threads

  1. Grid Layout with paintComponent
    By mp06677 in forum New To Java
    Replies: 1
    Last Post: 03-06-2010, 01:20 PM
  2. Help redrawing large image
    By mountaindew4993 in forum Java Applets
    Replies: 4
    Last Post: 12-14-2009, 11:49 PM
  3. Grid layout frames GUI
    By fritz1474 in forum AWT / Swing
    Replies: 1
    Last Post: 10-15-2008, 02:04 AM
  4. problem in redrawing JTable
    By abhinav in forum AWT / Swing
    Replies: 0
    Last Post: 11-21-2007, 09:08 PM
  5. Help with Grid Layout
    By coco in forum AWT / Swing
    Replies: 1
    Last Post: 08-06-2007, 08:03 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
  •