Size of left/right component in a JSplitPane after setVisible()

Hi there,
Could you help me here,
I have a JSplitPane containing 2 JPanels, left and right ones. My app. sometimes needs to call setVisible(false) on these when they are not required. Then, if they are needed again, I call setVisible(true) on them, however after this call, the JPanels are of size 0, so you can't actually see them unless you drag the dividor.
How do I get the size of these JPanels to return to what they were before calling setVisible(false)?

Hi there,
Could you help me here,
I have a JSplitPane containing 2 JPanels, left and right ones. My app. sometimes needs to call setVisible(false) on these when they are not required. Then, if they are needed again, I call setVisible(true) on them, however after this call, the JPanels are of size 0, so you can't actually see them unless you drag the dividor.
How do I get the size of these JPanels to return to what they were before calling setVisible(false)?

Similar Messages

  • The visible size of the Let/Right Component for JSplitPane

    Hi all,
    I am doing a project on map plotting. But i Don't know the way to get the visible size of the Let/Right Component (example JPanel) for a JSplitPane. Can anybody help? Thanks a lot!

    Hi,
    if you're just interested in the size you could use getDividerLocation().
    something else could be:
    getJSplitPane().getWidth()-(getJSplitPane().getDividerLocation()+getJSplitPane().getDividerSize())that gives you the Width of the right part
    Phil

  • Type on a path that gradually increases in size from left to right

    I need to create type on a path where the characters gradually increase in size from left to right. I know that I can manually change the size of each character, but does anyone know of an easier way to do this -- possibly with a script?

    This previous discussion might prove useful:
    http://forums.adobe.com/message/1275493#1275493
    The link to the script mentioned in the above thread is broken, but this one should work:
    http://forums.adobe.com/message/1258988#1258988

  • Track component change in JSplitPane

    I have a JSplitPane object and I want to track changes of the right component. I've tried to use a Property Change listener but it proved that I can track only ancestor, dividerLocation and lastDividerLocation properties.
    Please help. Thanks!
    The code looks like this:
    JSplitPane top;
    top = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, left, right);
    top.addPropertyChangeListener(this);
    public void propertyChange(PropertyChangeEvent e) {
    System.out.println(e.getPropertyName());
    }

    Should I use a ContainerListener instead of PropertyChangeListener ?

  • JSplitPanel--- divider locates at the left(upper) component

    I want the divider is located at the right(under) component.
    run this program you will see my effect, and fix this problem. thanks for reading
    import java.awt.BorderLayout;
    import java.awt.FlowLayout;
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.net.Socket;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JSplitPane;
    import javax.swing.JTabbedPane;
    import javax.swing.JTextArea;
    import javax.swing.JTextField;
    import javax.swing.JTree;
    import javax.swing.tree.DefaultMutableTreeNode;
    public class ChatFrame extends JFrame{
         private JTree tree = null;
         private ClientNode[] clientArray= new ClientNode[9999];
         private JTextArea textChat=null;
         private JTextField [] textBox = new JTextField[9999];
         private Socket connection=null;
         private BufferedReader in = null;
         private PrintWriter out = null;
         private int port;
         private JTabbedPane communicationTab;
         private JButton sendButton;
         public ChatFrame(int port){
              setSize(300,300);
              this.port = port;
              DefaultMutableTreeNode user = new DefaultMutableTreeNode("Another users");
              DefaultMutableTreeNode Client1 = new DefaultMutableTreeNode("Client 1");
              user.add(Client1);
              tree = new JTree(user);
              JScrollPane treeScrollPane = new JScrollPane(tree);
              JPanel p = new JPanel();
              p.add(treeScrollPane);
              communicationTab = new JTabbedPane();
              JSplitPane upperSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,communicationTab,p);
              upperSplitPane.setContinuousLayout(true);
              upperSplitPane.setOneTouchExpandable(true);
              upperSplitPane.setLastDividerLocation(1);
              textChat = new JTextArea();
              textChat.setLineWrap(true);
              textChat.setWrapStyleWord(true);
              JScrollPane scroll = new JScrollPane(textChat);
              JPanel q = new JPanel();
              sendButton = new  JButton("Send");
              sendButton.setSize(2,2);
              q.setLayout(new FlowLayout());          
              q.add(sendButton);
              JPanel tc = new JPanel();
              tc.setLayout(new BorderLayout());
              tc.add(scroll, BorderLayout.CENTER);
              tc.add(q,BorderLayout.EAST);
              JSplitPane underSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,upperSplitPane,tc);
              underSplitPane.setLastDividerLocation(1);
              getContentPane().add(underSplitPane,"Center");
         public void connectToServer(){
              try{
                   connection = new Socket("serverName",getPort());
                   while(true){
                        in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                        out = new PrintWriter(connection.getOutputStream());
                        String s = in.readLine();
                        if(s!=null){
                             textChat.append(s);
              }catch(Exception e){
         public int getPort(){
              return port;
         public static void main(String[] args){
              ChatFrame c = new ChatFrame(903);
              c.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              c.show();
    }

    thanks smith...
    I have resolved my problem at this evening...
    I have just used setResizeWeight(double C);
    C value of 0, the default, indicates the right/bottom component gets all the extra space (the left/top component acts fixed), where as a value of 1 specifies the left/top component gets all the extra space (the right/bottom component acts fixed). Specifically, the left/top component gets (weight * diff) extra space and the right/bottom component gets (1 - weight) * diff extra space.
    thanks so much.. You make try to fight this project all I have...

  • HI. I would like to arrange over 30 pictures into one grid-like ARRANGEMENT. (meaning above, below, left, right, of each other and so forth to form a rectangle)

    HI. I would like to arrange over 30 pictures into one grid-like ARRANGEMENT. (meaning above, below, left, right, of each other and so forth to form a rectangle)
    Please help...thx

    You messaged me that the contact sheet look is what want but w/o spaces.
    One method is to actually start with the PSE contact sheet tool.  I assume your version has it (mine is PSE 2). Maybe your version has an option to remove spaces; mine doesn't. In this example I created a sheet of  4 rows and 3 columns, with the option to not flatten the layers. Each picture appears on a separate layer.
    On each row I moved the left and right pics inward to remove the spaces between the pics:
    Activate the Move tool. Click on the left pic and use the arrow keys to move it inward. Same with the right pic.
    Now to remove the spaces between the rows. To make this easier. lock together the pics on each row. Here I locked the pics on the top row, then used the arrow keys to move the row as a unit downward.  An alternative method would be to merge the 3 pics on each row and move that merged layer.  Do the same for the remaining rows.
    This method works of course if the pictures are all the same size and all aligned vertical or horizontal.
    If you don't want to use the contact sheet tool (e.g., if the pics are different sizes or alignment) you can do this:
    Create a blank canvas.
    Open a picture, select it (Select > All) and copy to the clipboard (Edit > Copy).
    Activate the blank canvas and Edit > Paste. The picture will be placed on its own layer.
    Do the same with the remaining pics and use the Move tool with mouse and/or arrow keys to position them where you want.
    The advantage of the first method is that the rows and columns are precisely aligned.  Using the mouse to align the pictures could be a little tricky.

  • IMac 5.5, OS 10.6.8 During startup, the screen aspect changes so that the image is larger than the screen; I have to scroll to find top, bottom, left, right extremes.

    Screen display aspect ration suddenly changed while I was online so that I have to scroll to see the edges of the display: up, down, left, right.  I rebooted the computer and the problem persists.

    System Preferences->Displays->Display and reset resolution to desired size. Don't know of anything that would change that except possibly a failing graphics card.
    27" i7 iMac (Mid 2011) refurb, OS X Yo (10.10), Mavs, ML & SL, G4 450 MP w/10.5 & 9.2.2

  • Why cannot I resize the Tiles area of the start menu when the Task Bar is anywhere but at the bottom (Left, Right, Top)

    I have been using the Taskbar on the LEFT. Even before it came to windows, I used a freeware taskbar written by some dev - if I am not mistaken in Windows 3
    This is because it is always easier to move the mouse Left-Right than Up-Down without lifting your hand off the mouse to reset the position, especially now in these times of hires monitors.
    The taskbar is by default at the bottom in Win 10. Why? Who knows. I moved it to the left.  I found that when the taskbar is at the bottom, I could pop out the startmenu and RESIZE the TILES area. 
    But in any other position, Left, Top or Right you cannot resize the tile area of the taskbar. You first have to set it to the bottom, resize and then reset it left and if this is the wrong size for you you have to go thru all this over and over.
    Since resizing is allowed for the taskbar it should not be restricted to only the bottom setting users.
    Bernard

     I found that when the taskbar is at the bottom, I could pop out the startmenu and RESIZE the TILES area. 
    But in any other position, Left, Top or Right you cannot resize the tile area of the taskbar.
    I can confirm your finding. It's clearly wrong to have such an
    inconsistency. Have you reported it using the reporting facility?
    Dave

  • PS3 Controller left/right on main analog stick don't work

    I tried this out on two computers both running arch and had this same issue, and one running Windows that did not. It seems the left/right axis on the left analog stick don't work at all, only up/down works. The right stick works fine.
    I tried to map the axis on Dophin-emu and Snes9x-gtk. Dolphin didn't recognize the axis at all, snes9x seemed to map it out fine, but when it came to playing a game, it did not function. I'm not using any extra drivers or software for this.
    uname -a
    Linux Avalon 3.2.2-1-ARCH #1 SMP PREEMPT Thu Jan 26 08:40:20 CET 2012 x86_64 Intel(R) Core(TM)2 Quad CPU Q8200 @ 2.33GHz GenuineIntel GNU/Linux
    EDIT: cat /dev/input/js0 returns some values when the stick is moved left and right
    Last edited by Sileem (2012-01-29 20:25:31)

    The input in Ubuntu is a bit different, and there's no Snes9x to test, so that's inconclusive. Many other controllers seem to have Axis 1-4, whereas the PS3 controller lists the axes as 0-3. All of the axes but 0 (left and right on left analog) work. I wonder if this is some glitch where some component expects 0 to be null or something. Then again, I think it's always been that way.
    I don't have any other gamepads around to test out, but I'm scouring the 'net for a solution. It seems unlikely I'll find one, however. This thread is the only one on the internet that has a vaguely similar problem.
    UPDATE: It appears jscal can't calibrate the controller (after "Calibrating precision: wait and don't touch the joystick." it says "Bus error" and quits). jscal -t reports "axes not calibrated." Not sure what to think of that.
    Last edited by ScionicSpectre (2012-05-01 00:51:59)

  • Alt shortcuts not working for alt-left/right or for é, í etc

    Hi guys,
    I've had this problem for a while now… Essentially, the issue lies in the alt-shortcuts for left and right where one is usualy able to 'word jump', and the creation of accented characters like é and í using the alt-e shortcut. All other alt functions appear to work fine for the moment. The alt-left/right shortcut still works when shift is held down, and highlights all the characters that have been passed over, as it should. The output for alt-e is completely blank, and the alt-left/right output is nothing, unless shift is also held.
    I have a British English MacBook Air keyboard on Mountain Lion, and I have set it to that layout, and I regularly switch between this and greek for scientific formulæ. I've fiddled around with language and input settings trying to get it to work again to no avail, and there are no shortcuts programmed to that to my knowledge. I have checked on a guest account and it seems to be account specific. Ideally I'd like to keep this account without migrating everything over - does anyone have any ideas with regards to how to track down where the problem is?
    Thanks in advance to any responses!

    If only alt + e is not working, double check system preferences/speech to make sure it has not been set as a trigger for text to speech or speech recognition or whatever.

  • IPhoto 09 - iDVD 09: black Borders left/right AND top/bottom

    Setup: Snow Leopard 10.6.3, iPhoto 09, iDVD 09, all patches applied.
    Source Material: HiDef 3:2 pictures in iPhoto, arranged in a iPhoto slideshow.
    Export: "publish to iDVD" in iPhoto - everything works fine.
    Settings in iDVD: professional quality, Always scale slide to TV Safe area: DISABLED. aspect ratio: 16:9
    Target: Full HD TV Screen 16:9
    Result: the image quality is not great, but ok. But: there are huge black borders left/right (which is perfectly fine given the difference between 16:9 and 3:2) AND on the top and buttom of the TV - which is not acceptable by any means.
    When I start the DVD on the Mac DVD-Player, there are no borders in windowed mode, but in full screen too.
    It seems as iDVD 09 simply ignores the uncecked "scale..." preset box.
    Can anyone confirm this, any suggestions? Setting up the slideshow in iDVD/iMovie itself is not an option here, hence my dad is still struggling to get things right in iPhoto

    Bengt Wärleby wrote:
    If You select to play back in a smaller window eg cmd+2 or on a TV (4x3)
    • still got the border all around ? (it's OK on my Mac (cmd+1 or 2) or on TV)
    No, it's just in fill screen mode.
    Bengt Wärleby wrote:
    This is not an iMovie or Apple problem but due to mixing 4x3 and 16x9 material
    It's 2:3 Material (DSLR Pictures), so this won't help.
    Bengt Wärleby wrote:
    You can try to make this the other way around. Start a WideScreen project and
    now You will get the bordet around the 4x3 material instead.
    Only solution is to crop or enlarg one of the material types to get it right.
    As I stated before, there HAVE to be borders for the 2:3 Material on a 16:9 Screen (unless you do some heavy cropping). But I can see no reason why there should be borders on top/bottom of ANY material. As I see it, it's a problem related to a disfuncional "adjust for TV" setting, not the aspect ratio.
    Thanks anyway.
    Any other comments?

  • Display screen moves up/down & left/right

    I am using a Cinema display on a G5 and when I move my mouse around the screen the screen shifts by several pixels to the left/right/top/or bottom depending on which way I am moving the mouse. It is as if the screen does not fit completely within the display. Right now my resolution is set to: 1680x1050.
    Its a strange problem that is really more distracting than anything else. Any ideas regarding what I can do to fix this?
    many thanks,
    Zach

    Open the Universal Access pane of System Preferences and turn off the Zoom option in the Seeing tab.
    (24932)

  • Add tool tip to left right button in JTabbedPane??

    Hi,
    I am using a tabbed pane with follwong setting.
    tabPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
    So when the no of tab is more a left right button appears.
    I want to add tool tip to these button
    How do i get the instance of these buttons
    thnx
    Neel

    try this for east/west, similar for north/south
    (hopefully there's an easier way)
    import java.awt.*;
    import javax.swing.*;
    class Testing extends JFrame
      public Testing()
        setLocation(300,200);
        setSize(150,100);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        JTabbedPane tp = new JTabbedPane();
        tp.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
        tp.setUI(new MyUI());
        for(int x = 0; x < 12; x++)
          JPanel p = new JPanel();
          p.add(new JLabel(""+x));
          tp.addTab(""+(char)(x+65),p);
        getContentPane().add(tp);
      class MyUI extends javax.swing.plaf.metal.MetalTabbedPaneUI
        protected JButton createScrollButton(int direction)
          if (direction != SOUTH && direction != NORTH && direction != EAST && direction != WEST)
              throw new IllegalArgumentException("Direction must be one of: SOUTH, NORTH, EAST or WEST");
          return new ScrollableTabButton(direction);
        private class ScrollableTabButton extends javax.swing.plaf.basic.BasicArrowButton implements javax.swing.plaf.UIResource,SwingConstants
          public ScrollableTabButton(int direction)
            super(direction, UIManager.getColor("TabbedPane.selected"),
                             UIManager.getColor("TabbedPane.shadow"),
                             UIManager.getColor("TabbedPane.darkShadow"),
                             UIManager.getColor("TabbedPane.highlight"));
            if(direction == WEST) setToolTipText("<<<<<");
            else if(direction == EAST) setToolTipText(">>>>>");
      public static void main(String[] args){new Testing().setVisible(true);}
    }

  • Ios7.0.2 iPad multigesture left right broken

    Pre ios7.0.2, was able to use multigesture swipe from right of screen to display open windows. After downloading 7.0.2 left right multigesture doesn't work. To display open windows (and swipe upwards to close them), I have to press twice on big button on bottom of iPad. How can I get left/right multigesture to work on ios7.0.2?

    Go to the Settings app. Select General and make sure the switch for Multitasking Gestures is turned on. It will show green. If that is already on, switch it to off, close the Setting app then go back in and turn it on again. If this doesn't correct your issue then
    Try a Restart.
    Press and hold the Sleep/Wake button for a few seconds until the red "slide to power off" slider appears, and then slide the slider. Press and hold the Sleep/Wake button until the Apple logo appears.
    Resetting your settings
    You can also try resetting all settings. Settings>General>Reset>Reset All Settings. You will have to enter all of your device settings again.... All of the settings in the settings app will have to be re-entered. You won't lose any data, but it takes time to enter all of the settings again.
    Resetting your device
    Press and hold the Sleep/Wake button and the Home button together for at least ten seconds, until the Apple logo appears. Apple recommends this only if you are unable to restart it.
    Or if this doesn't work and nobody else on the blog doesn't have a better idea you can contact Apple.
    Here is a link to their contacts with most of the information below.
    http://www.apple.com/contact/

  • Magic Mouse left right swipe not working

    I got the mouse with my computer about a month ago. And suddenly, the left/right swipe has stopped working. I've wiped down the top and changed the batteries. I restarted. It doesn't seem to be working.
    Has anyone else had this problem? Does anyone know how to fix it?

    Take it back to Apple and get a new one, yours is still under warranty.

Maybe you are looking for

  • Can I download music from iTunes to 2 itouches

    My computer with iTunes which my itouch was synced to crashed, literally died. I threw it out and had no back-up so lost everything on it (still don't know how to make backup). I bought a new computer, re-downloaded iTunes and my several days worth o

  • Sharepoint online & Sharepoint Designer 2013

    Hi, I am receiving an error each time I try to open a SharePoint online site through SharePoint designer 2013. The error is saying "The Server Could not complete your request". I click on 'Details' and get a repeated "403 Forbidden403 Forbidden403 Fo

  • ITunes 12 artwork missing but really missing

    As you can see here. The file has artwork attached but it's not showing up in iTunes. It's sporadiac which albums appear not to have the artwork and these albums will also not transfer the music file with artwork to my iPhone. I'm obsessive with tagg

  • Delete archivelogs on a manual standby with RMAN

    Hi, Using Oracle 10.2.0.3 Standard Edition, I created a manual physical standby database with a standby controlfile. FRA is configured on both servers. I want to use RMAN (recovery catalog in the controlfile) to delete archivelogs on the standby serv

  • When Installing  Mountain Lion,showing error and taking 8-10 hrs for download and unable to Install

    Dear All, I purchased new Macbook Air.When I download free Mountain Lion is given by Macbook,which is taking 8-10 hrs to download a littile bit and showing error message,try again...but I could not download and Instal the same.again and again showing