'dotted' / 'bumpy' background like JSplitPane divider

Is there a way to get the background of a JPanel to have the nice 'dotted' (is 'bumpy' more correct ?) look of the light grey divider that Swing uses for such things as JSplitPane ?

Too many panels you are having. Try none:
import java.awt.*;
import java.net.*;
import javax.swing.*;
public class SplitExample {
     public static void main(String[] args) throws MalformedURLException {
          JLabel left = new JLabel("LEFT");
          URL url = new URL("http://weblogs.java.net/jag/bio/JagHeadshot-small.jpg");
          JLabel right = new JLabel(new ImageIcon(url));
          JSplitPane sp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, left, right);
          JFrame f = new JFrame("SplitExample");
          f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          f.getContentPane().add(sp);
          f.pack();
          f.setLocationRelativeTo(null);
          f.setVisible(true);
}

Similar Messages

  • Is there a way to make Illustrator save in the background, like Photoshop?

    Out of Photoshop, InDesign and Illustrator, Illustrator is definitely the one I have most problems working with, due to small UI differences and ways of handling things
    Like the fact that you can't drag next to a number to change it, like in Photoshop. Or the fact that I can't sync my settings (it only says "Signed in as:", and when I press Manage Account, I'm taken to my CC files in Safari).
    But most annoying is the fact that whenever I'll save a document in Illustrator, a dialogue box opens letting me know the progress of the saving. Not only does this make me unable to continue working on the document (if the file is large, it takes some time), the app icon starts jumping in the dock if I switch to another program before the box appears.
    So, is there any way to make it save in the background, like in Photoshop? I'm running OS X, with Illustrator version 17.1.0.

    This really frustrates me, small differences between the apps that shouldn't be there.
    I understand you can't change the keyboard shortcuts to be the same/similar, but this is totally different. Let's hope it changes soon.

  • JSplitPane divider (One touch expandable)

    Hi all,
    I am having some problems with the JSplitPane divider. I am using onetouch expandable.
    I want to stop the divider moving all the way up to the top of the window when the up arrow is clicked on. When you drag the divider up it stops near the top but doesn't go all the way up. but click on the up arrow on the divider bar and it rises completely to the top. How can I stop this from happening.
    I have managed to add an action listener to the buttons on the divider bar, In the action listener I do the following - splitPane.setDividerLocation(0.1);
    splitPane.updateUI();
    This works but then an exception is thrown -
    Exception occurred during event dispatching:
    java.lang.NullPointerException
         at javax.swing.plaf.basic.BasicSplitPaneDivider$OneTouchActionHandler.actionPerformed(BasicSplitPaneDivider.java:916)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1504)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:378)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:250)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:216)
         at java.awt.Component.processMouseEvent(Component.java:3717)
         at java.awt.Component.processEvent(Component.java:3546)
         at java.awt.Container.processEvent(Container.java:1167)
         at java.awt.Component.dispatchEventImpl(Component.java:2595)
         at java.awt.Container.dispatchEventImpl(Container.java:1216)
         at java.awt.Component.dispatchEvent(Component.java:2499)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2458)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2223)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2132)
         at java.awt.Container.dispatchEventImpl(Container.java:1203)
         at java.awt.Window.dispatchEventImpl(Window.java:918)
         at java.awt.Component.dispatchEvent(Component.java:2499)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:336)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:134)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:101)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:96)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:88)
    Can anyone help me out?
    thanks,
    Paul.

    I have partial solution to the above problem but in doing so have encountered another problem that I can see no solution to. Can anyone help?
    I have a calss that extends BasicSplitPaneDivider and in this calss i overide the OneTouchActionHandler with a version that sets the top value to be the top of the frame + the height of the component I want left shown. My problem is that this code never runs. The origional OneTouchActionHandler in the BasicSplitPaneDivider runs not my version. How can I get my version to run.
    The version in BasicSplitPaneDivider is protected.
    This code never runs.
    <pre>
    * Listeners installed on the one touch expandable buttons.
    public class OneTouchActionHandlernew implements ActionListener {
         /** True indicates the resize should go the minimum (top or left)
         * vs false which indicates the resize should go to the maximum.
         private boolean toMinimum;
         OneTouchActionHandlernew(boolean toMinimum) {
         this.toMinimum = toMinimum;
    public void actionPerformed(ActionEvent e) {
    Insets insets = splitPane.getInsets();
         int lastLoc = splitPane.getLastDividerLocation();
    int currentLoc = splitPaneUI.getDividerLocation(splitPane);
         int newLoc;
         // We use the location from the UI directly, as the location the
         // JSplitPane itself maintains is not necessarly correct.
    System.out.println("The action listener is being used ");
         if (toMinimum) {
              if (orientation == JSplitPane.VERTICAL_SPLIT) {
              if (currentLoc >= (splitPane.getHeight() -
                        insets.bottom - getDividerSize()))
                   newLoc = lastLoc;
              else
                   newLoc = insets.top + 40;
              else {
              if (currentLoc >= (splitPane.getWidth() -
                        insets.right - getDividerSize()))
                   newLoc = lastLoc;
              else
                   newLoc = insets.left;
         else {
              if (orientation == JSplitPane.VERTICAL_SPLIT) {
              if (currentLoc == insets.top)
                   newLoc = lastLoc;
              else
                   newLoc = splitPane.getHeight() - getHeight() -
                   insets.top;
              else {
              if (currentLoc == insets.left)
                   newLoc = lastLoc;
              else
                   newLoc = splitPane.getWidth() - getWidth() -
                   insets.left;
         if (currentLoc != newLoc) {
              splitPane.setDividerLocation(newLoc);
              // We do this in case the dividers notion of the location
              // differs from the real location.
              splitPane.setLastDividerLocation(currentLoc);
    } // End of class BasicSplitPaneDivider.LeftActionListener
    </pre>

  • I upgraded to the 7.0.3. Is there a way to get rid of apps running in the background like in previous versions?

    I upgraded to the 7.0.3. Is there a way to get rid of apps running in the background like in previous versions?

    Double tap the home button and swipe up on the app screen shot, to close out of the app in multitasking.

  • Why can't I save my entire picture as my background like before?

    Why can't I save my entire picture as my background like before?

    https://discussions.apple.com/thread/5318510?tstart=0

  • When sharing an email the background like corkboard is not there- just black background shows. How do I fix this?

    When sharing an email the background like corkboard is not there- just black background shows. How do I fix this?

    Check, if the backgrounds are installed correctly in the system library.
    Compare with your other two apples
    The corkboard pattern and other backgrounds should be found in
    /Library/Application Support/iPhoto/Themes/Shared/Backgrounds/
    /Library/Application Support/iPhoto/Themes/Assets/Email/
    /Library/Application Support/iPhoto/Themes/Assets/Shared/Backgrounds/Cork/corktile.jpg
    To quickly open these folders select the complete line above, ctrl-click it (or right-click) and select "Services" from the pop-up menu. Then select "Open".
    Inspect the folder that opens and compare with your other mac, if all files are there and if the permissions are set correctly. Restore from your other mac, if necessary or reinstall iPhoto to restore.
    If all folders are there and missing theme files are not the problem, post back.
    Regards
    Léonie

  • Another JSplitPane divider cursor problem

    I have the same problem discussed elsewhere in that the cursor doesn't change to a E_RESIZE_CURSOR when it's over a split panel divider. The code is in a large application too huge to post, and my attempts to simplify it have been unable to reproduce the problem. I have implemented the solution suggested in [http://forums.sun.com/thread.jspa?forumID=57&threadID=642994] but, although the mouse listener methods are indeed called, the cursor doesn't change. I have also tried calling setCursor on the parent of the JSplitPane, and on the JRootPane, but it doesn't change. In each case the mouse listener is called but the setCursor call has no effect.
    All the discussions on setCursor having no effect I've found are specific to JDialog. In my case, I have a deep window stack starting with JFrame, JRootPane, JLayeredPane, down through several JPanels, a JSplitPane, more JPanels, my JSplitPane, which contains 2 JPanels, and so on.
    What would prevent the JSplitPane divider from changing the cursor itself? Assuming it's trying, just as my explicit mouse listener is, what could be overriding, obscuring, or intercepting my cursor change?
    Any help would be most welcome
    Thanks!

    I have the same problem discussed elsewhere in that the cursor doesn't change to a E_RESIZE_CURSOR when it's over a split panel divider. The code is in a large application too huge to post, and my attempts to simplify it have been unable to reproduce the problem. I have implemented the solution suggested in [http://forums.sun.com/thread.jspa?forumID=57&threadID=642994] but, although the mouse listener methods are indeed called, the cursor doesn't change. I have also tried calling setCursor on the parent of the JSplitPane, and on the JRootPane, but it doesn't change. In each case the mouse listener is called but the setCursor call has no effect.
    All the discussions on setCursor having no effect I've found are specific to JDialog. In my case, I have a deep window stack starting with JFrame, JRootPane, JLayeredPane, down through several JPanels, a JSplitPane, more JPanels, my JSplitPane, which contains 2 JPanels, and so on.
    What would prevent the JSplitPane divider from changing the cursor itself? Assuming it's trying, just as my explicit mouse listener is, what could be overriding, obscuring, or intercepting my cursor change?
    Any help would be most welcome
    Thanks!

  • JSplitPane Divider problem...

    I'm having problem with the JSplitPane divider. Ive learned that the MouseListener class is most likely the reason why the divider isn't performing as expected. I had to learn how to use the MouseListener interface and I've also learned that the divider is an instance of BasicSplitPaneDivider. I've finally got the divider to PARTIALLY work if I only set the following:
    1) setting the setContinuousLayout(true)
    //setting it to false wont work for some reason, I want to fix that, too. By setting it to false, the divider wont move :(.
    and
    2) if I move the mouse slowly, so the divider can follow the mouse. If I move my mouse too fast, then my divider will suddenly stop the moment the mouse cursor hovers away from the divider.
    Can anyone help me fix the divider problem? Thanks in advance! Here's my code below:
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.*;
    import java.awt.event.MouseEvent;
    import javax.swing.event.MouseInputAdapter;
    import javax.swing.plaf.basic.BasicSplitPaneDivider;
    public class JSplitPaneDemo{
         public static void main(String args[]){
              //Practice p = new Practice("SplitPane Divider Works Now?");
              JSplitPaneDemo x = new JSplitPaneDemo();
              x.new Practice("SplitPane Divider Works Now?");
         public class DendrogramListener extends MouseInputAdapter
              Container contentPane;
              Component button1, button2, button3;
              JSplitPane splitter;
              Point mLocation;
              JFrame myFrame;
              MyGlassPane glass;
              private boolean inDrag = false;
              private boolean inButton = false;
              private boolean inDivider = false;
              public DendrogramListener(JFrame frame)
                   this.myFrame = frame;
                   this.contentPane = frame.getContentPane();
                   this.mLocation = new Point();
              public DendrogramListener(AbstractButton aButton, AbstractButton b2, AbstractButton b3, MyGlassPane glass1, Container cP, JSplitPane split){
                   this.button1 = aButton;
                   this.button2 = b2;
                   this.button3 = b3;
                   this.glass = glass1;
                   this.contentPane = cP;
                   this.mLocation = new Point();
                   this.splitter = split;
              public void mouseDragged(MouseEvent arg0) {
                   // TODO Auto-generated method stub
                   redispatchMouseEvent(arg0);
              public void mouseMoved(MouseEvent arg0) {
                   // TODO Auto-generated method stub
                   redispatchMouseEvent(arg0);
              public void mouseClicked(MouseEvent arg0) {
                   // TODO Auto-generated method stub
                   redispatchMouseEvent(arg0);
              public void mousePressed(MouseEvent arg0) {
                   // TODO Auto-generated method stub
                   redispatchMouseEvent(arg0);
              public void mouseReleased(MouseEvent arg0) {
                   // TODO Auto-generated method stub
                   redispatchMouseEvent(arg0);
                   inDrag = false;
              public void mouseEntered(MouseEvent arg0) {
                   // TODO Auto-generated method stub
                   redispatchMouseEvent(arg0);
              public void mouseExited(MouseEvent arg0) {
                   // TODO Auto-generated method stub
                   redispatchMouseEvent(arg0);
              public void redispatchMouseEvent(MouseEvent e){
                   inButton = false;
                   inDrag = false;
                   inDivider = false;
                   Component component = null;
                   JButton tempButton;
                   Container container = contentPane;
                   Point glassPanePoint = e.getPoint();
                   mLocation = e.getPoint();
                   Point containerPoint = SwingUtilities.convertPoint(glass, glassPanePoint, contentPane);
                   int eventID = e.getID();
                 component = SwingUtilities.getDeepestComponentAt(container, containerPoint.x, containerPoint.y);
                 if (component == null) {
                      //System.out.println("NULL");
                     return;
                 if (component instanceof JButton) {
                     inButton = true;
                 if(component instanceof BasicSplitPaneDivider){
                      inDivider = true;
                      testForDrag(eventID);
                 if (inButton || inDivider)
                           Point componentPoint = SwingUtilities.convertPoint(glass, glassPanePoint, component);
                          component.dispatchEvent(new MouseEvent(component,
                                                               eventID,
                                                               e.getWhen(),
                                                               e.getModifiers(),
                                                               componentPoint.x,
                                                               componentPoint.y,
                                                               e.getClickCount(),
                                                               e.isPopupTrigger()));
                   testForDrag(eventID);
             private void testForDrag(int eventID) {
                 if (eventID == MouseEvent.MOUSE_PRESSED) {
                     inDrag = true;
         public class MyGlassPane extends JComponent {
              int x0, y0;
              Point mLocation;
              public MyGlassPane(AbstractButton aButton, AbstractButton b2, AbstractButton b3, Container cP, JSplitPane splitter){
                   DendrogramListener dl = new DendrogramListener(aButton, b2, b3, this, cP, splitter);
                   addMouseListener(dl);
                   addMouseMotionListener(dl);
             public void setPoint(Point p) {
                 mLocation = p;
         public class Practice extends JFrame implements ActionListener
              private MyGlassPane glassPane;
              public Practice(String str)
                   super(str);
                   setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                   setDefaultLookAndFeelDecorated(true);
                   addComponents(this);
                   pack();
                   setVisible(true);
              public Practice addComponents(final Practice p)
                   JPanel leftPane = new JPanel();
                   JPanel midPane = new JPanel();
                   JPanel rightPane = new JPanel();
                   JLabel l1 = new JLabel("Left panel");
                   JLabel r1 = new JLabel("Right panel");
                   JLabel m1 = new JLabel("Middle panel");
                   JButton b1 = new JButton("Button 1");
                   JButton b2 = new JButton("Button 2");
                   JButton b3 = new JButton("Button 3");
                   leftPane.add(l1);
                   leftPane.add(b3);
                   b3.setActionCommand("b3");
                   b3.addActionListener(this);
                   leftPane.setPreferredSize(new Dimension(200, 300));
                   midPane.add(m1);
                   midPane.add(b1);
                   midPane.setPreferredSize(new Dimension(200, 300));
                   rightPane.add(r1);
                   rightPane.add(b2);
                   rightPane.setPreferredSize(new Dimension(200, 300));
                   JSplitPane splitter2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, rightPane, midPane);
                   splitter2.setOneTouchExpandable(true);
                   splitter2.setContinuousLayout(true);
                   JSplitPane splitter = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftPane, splitter2);
                   splitter.setOneTouchExpandable(true);
                   splitter.setContinuousLayout(true);
                   getContentPane().add(splitter);
                   glassPane = new MyGlassPane(b1, b2, b3, p.getContentPane(), splitter);
                   this.setGlassPane(glassPane);
                   glassPane.setVisible(true);
                   return p;
              public void actionPerformed(ActionEvent arg0) {
                   // TODO Auto-generated method stub
                   if("b3".equals(arg0.getActionCommand())){
                        JOptionPane.showMessageDialog(this, "Button 3 Pressed!");
    }

    The problem with your listener is that you are only dispatching events to the
    button or divider when the mouse is directly over that component. This results
    in the behavior you see with the divider: you have to move the mouse slowly
    to keep it over the divider otherwise it gets over some other component and
    you stop dispatching the events to it.
    You actually have a similar problem with the buttons: if you click on one, it
    gets the event but if you then drag the mouse out of the button and release
    the mouse, it still triggers the button! This is not how buttons work: if you
    release the mouse when it is not over the button, it shouldn't trigger.
    Try this for your listener:
         public class DendrogramListener extends MouseInputAdapter {
              Component redispatch;
              boolean inside;
              Container contentPane;
              Component button1, button2, button3;
              JSplitPane splitter;
              Point mLocation;
              JFrame myFrame;
              MyGlassPane glass;
              private boolean inDrag = false;
              private boolean inButton = false;
              public DendrogramListener( JFrame frame ) {
                   this.myFrame = frame;
                   this.contentPane = frame.getContentPane();
                   this.mLocation = new Point();
              public DendrogramListener( AbstractButton aButton, AbstractButton b2,
                        AbstractButton b3, MyGlassPane glass1, Container cP,
                        JSplitPane split ) {
                   this.button1 = aButton;
                   this.button2 = b2;
                   this.button3 = b3;
                   this.glass = glass1;
                   this.contentPane = cP;
                   this.mLocation = new Point();
                   this.splitter = split;
              public void mouseDragged( MouseEvent arg0 ) {
                   redispatchMouseEvent( arg0 );
              public void mouseMoved( MouseEvent arg0 ) {
                   redispatchMouseEvent( arg0 );
              public void mouseClicked( MouseEvent arg0 ) {
                   redispatchMouseEvent( arg0 );
              public void mousePressed( MouseEvent arg0 ) {
                   redispatchMouseEvent( arg0 );
              public void mouseReleased( MouseEvent arg0 ) {
                   redispatchMouseEvent( arg0 );
                   inDrag = false;
                   inButton = false;
              public void mouseEntered( MouseEvent arg0 ) {
                   redispatchMouseEvent( arg0 );
              public void mouseExited( MouseEvent arg0 ) {
                   redispatchMouseEvent( arg0 );
              public void redispatchMouseEvent( MouseEvent e ) {
                   int eventID = e.getID();
                   Point glassPanePoint = e.getPoint();
                   Point containerPoint = SwingUtilities.convertPoint( glass, glassPanePoint, contentPane );
                   if ( !inDrag && !inButton && eventID == MouseEvent.MOUSE_PRESSED ) {
                        redispatch = SwingUtilities.getDeepestComponentAt( contentPane, containerPoint.x, containerPoint.y );
                        inButton = ( redispatch instanceof JButton );
                        inside = inButton;
                        if ( !inButton )
                             inDrag = ( redispatch instanceof BasicSplitPaneDivider );
                   if ( inButton || inDrag ) {
                        if ( inButton )
                             eventID = possiblySwitchEventID( eventID, containerPoint );
                        Point componentPoint = SwingUtilities.convertPoint( glass, glassPanePoint, redispatch );
                        redispatch.dispatchEvent( new MouseEvent( redispatch, eventID, e.getWhen(), e.getModifiers(),
                                  componentPoint.x, componentPoint.y, e.getClickCount(), e.isPopupTrigger() ) );
              private int possiblySwitchEventID( int eventID, Point containerPoint ) {
                   int switchedID = eventID;
                   Component deepest = SwingUtilities.getDeepestComponentAt( contentPane, containerPoint.x, containerPoint.y );
                   if ( deepest == redispatch ) {
                        if ( ! inside )
                             switchedID = MouseEvent.MOUSE_ENTERED;
                        inside = true;
                   } else {
                        if ( inside )
                             switchedID = MouseEvent.MOUSE_EXITED;
                        inside = false;
                   return switchedID;
         }: jay

  • JSplitPane divider not movable

    What would prevent a JSplitPane divider from being movable in its initial state?
    The left pane contains a JTabbedPane, and the right pane contains a JPanel. When the app starts, the left pane is as wide as a single tab, and the divider cannot be dragged. If I click the right arrow on the divider, it expands to the right and then I can drag it.
    I don't observe this behavior in the JSplitPane examples in the tutorials. I figure it must be something about the pane contents that triggers this. But what?
    Braden

    make sure you set the min, max, and preferredsize of both sides of the splitpane

  • Center the JSplitPane divider inside a Jframe.

    I am trying to use the JSplitPane class. I want to set the divider in the middle of the Jframe it is in. I have size the Jframe to 500,500 and set the divider to 250. The problem is if you include the title bar of the Jframe then it looks like it is in the right spot but I don�t want to include the title bar I just want the internal part of the frame to be divided in half not the whole Jframe. Any suggestion on how to do that? Also how do you keep the divider in the center when the Jframe is resized. Thanks.

    setDividerLocation(0.5d) should do the job. if you want to set this in the constructor of your container, you should do this after everything else is done, somethinglike
    SwingUtilities.invokeLater(new Runnable()
    public void run()
    xxx.setDividerLocation(0.5d);
    });

  • JSplitPane divider too wide on first display

    I have two split panes nested into each other. For the second, inner one, I have a scrollpane with a table on the top and a scrollpane with a textpane on the bottom. When the Frame is shown for the first time, the divider for the inner splitpane is 5 times as wide as it should be.
    What makes things more complicated is that I add the Panel with the splitpane after a user event.
    Any idea,
    Joerg

    Hi,
    I ran into the same problem, and verified that calling "updateUI" on the JSplitPane does fix the problem. I do this just before I call visible on the main frame.
    Like the original poster, I also have a ScrollPane with a Jtable in one of the Split Panels. Maybe something about SplitPanes mixed with scrolly panes and/or tables causes this problem.

  • JSplitPane divider drag animation

    When resizing a JSPlitPane, there is a black bar that displays on the screen in place of the divider. Is there a way to remove this black bar or change the color?

    SetContinuousLayout() along with the mouseMotionListener and a custom UI does kind of what I want, except I lose the dotted decoration and border on the divider, this is what I have so far and it works in my application, though there's probably a better class I can extend to not paint the black bar with the lastDragPosition so I don't lose the decoration.
    import java.awt.Dimension;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseMotionListener;
    import javax.swing.BorderFactory;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JSplitPane;
    import javax.swing.plaf.basic.BasicSplitPaneUI;
    public class TestSplitPane {
         public TestSplitPane() {
              final JFrame frame = new JFrame();
              frame.setTitle("Test Split Pane Divider");
              JPanel topPanel = new JPanel();
              topPanel.setPreferredSize(new Dimension(400, 200));
              topPanel.setMinimumSize(new Dimension(400, 200));
              topPanel.setBorder(BorderFactory.createTitledBorder("Top Panel"));
              JPanel bottomPanel = new JPanel();
              bottomPanel.setBorder(BorderFactory.createTitledBorder("Bottom Panel"));
              final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, topPanel, bottomPanel);
              splitPane.setUI(new MySplitPaneUI());
              splitPane.setContinuousLayout(true);
              final BasicSplitPaneUI splitPaneUI = (BasicSplitPaneUI) splitPane.getUI();
              splitPaneUI.getDivider().addMouseMotionListener(new MouseMotionListener() {
                   public void mouseMoved(MouseEvent arg0) {
                   public void mouseDragged(MouseEvent arg0) {
                        final int currentDragY = ( splitPaneUI.getDividerLocation(splitPane) + arg0.getY());
                        splitPane.setDividerLocation(currentDragY);
                        frame.invalidate();
                        frame.repaint();
              frame.add(splitPane);
              frame.pack();
              frame.setVisible(true);
         public static void main(String[] args) {
              new TestSplitPane();
         private class MySplitPaneUI extends BasicSplitPaneUI {
              public MySplitPaneUI() {
                   super();
              public int getDividerLocation(JSplitPane jc) {
                   int loc = super.getDividerLocation(jc);
                   super.setLastDragLocation(loc);
                   return loc;
    }

  • Clicking on a JSplitPane divider.

    Hi,
    This may seem like a stupid question but, how can I detect clicks on the Divider of a JSplitPane? I can make it resize programmatically, and I simply want to resize it if it's double clicked on (according to the left component's preferred size).
    Many thanks.

    I do it this way:
    // frame class fields
    protected int splitPaneDefaultDividerLocation = -1;
    protected JSplitPane splitPane;
    // inside method for initialization of frame components,
    // after splitPane is created and added to the frame content pane
        SplitPaneUI spui = splitPane.getUI();
        if (spui instanceof BasicSplitPaneUI) {
          // Setting a mouse listener directly on split pane does not work, because no events are being received.
          ((BasicSplitPaneUI) spui).getDivider().addMouseListener(new MouseAdapter() {
            public void mouseClicked(MouseEvent e) {
              if (e.getClickCount() > 1) {
                if (splitPane.getDividerLocation() != splitPaneDefaultDividerLocation) {
                  splitPane.setDividerLocation(splitPaneDefaultDividerLocation);
                } else {
                  splitPane.setDividerLocation(0);
    // splitPane.getDividerLocation() returns last value passed to splitPane.setDividerLocation()
    // so at this point it returns -1 and cannot be used
        pack(); // Layout the components.
        splitPaneDefaultDividerLocation = splitPane.getUI().getDividerLocation(splitPane);

  • In c200 chat is not working on background like 273...

    In 2730 c i will get sound alart when i get a im i will be 24hours online Chat is not working in background in c200 like 2730 c so i cant use im all time how to make it work like 2730 c in my c200 both are s40 no

    Dude, make sure u are on a 3G network to ensure clarity, then also, install skype so that you can get some of those neccessary files/apps to carry out voice stuffs...

  • When playing ituens music on my windows computer - every few seconds there is a ctrang horn beep in the background - like there is an error message worning.  whats up

    when using ituens to playback music - there is a strange horn like beep sound in the background every 1 or less.  what to do to get rid of it

    Yes...It is very annoying. I spent all day trying to get this worked out and after a lot of trial and error and a lot of restarts I got iTunes to work.
    I deduced that I had a conflict of some sort and ruled it down to my temorary files that windows doesn't delete after it is finished with them. I cleaned out my temporary file by using this webpage http://personal-computer-tutor.com/deletingtempfiles.htm . After I did this my computer worked like it did when it was new!!
    This seemed to work for me and it might for you if you are having problems.

Maybe you are looking for

  • Manage-bde error via prompt.

    Hi !!! I have a big network with 200 Laptops all with Windows 7 32-bit version installed. Now i want to deploy bitlocker security with TPM,all this laptops have the TPM module enable. I'm installing bitlocker via remote prompt launching this command:

  • Duplicate target database not working

    Hi All, I want to clone my exisitng DB to other. I was refering the below link to do the same. [http://web.njit.edu/info/limpid/DOC/backup.102/b14191/rcmdupdb006.htm|http://web.njit.edu/info/limpid/DOC/backup.102/b14191/rcmdupdb006.htm] OS:Solaris 10

  • Adding fields to FAGLFLEXT totals table in New GL

    Hi Experts, I need a step-by-step of how to add the alternate account field (ALTKT) at totals table FAGLFLEXT. I need creating reports using report painter where the account shown must be the alternate account. Thanks Renato

  • Login issues using linked tables in Microsoft Access

    Hello everyone!!! Anybody knows how to set the ODBC Login and password for a group of Oracle ODBC linked tables in MS Access by using DAO or VBA?. I need to use DAO instead of ADO for my application since I use ODBC and an Oracle Database. I know I c

  • J2SE 6 and System tray ideas

    Guys .i'm a bit confused about few issues 1) whether J2SE6 = Mustang ? 2) Does either one of these support java.awt.SystemTray coz im looking 4 an API in java tht supports System tray functionality... 3) And i also saw tht "jdic" also supports system