Split Pane Divider and Fixing.

Hi there fellow swingers. I am having trouble (you could say pane) with a divider.
I basically want the user to be able to maximise and minimise a split pane but nothing in between.
so, I want mySplitPane.setOneTouchExpandable(true);but I do not want them to be able to move the split pane by dragging it.
using mySplitPane.setDividerSize(0); does not work as this will get rid of the scrollpane bar.
Any help is appricaiated in advance.

splitPane.setEnabled( false );

Similar Messages

  • Split Panes, Frame and Resizing

    Hi,
    my user interface is made up of a message panel using the created class SplitPanes2 through the method createSplitPanes called from a class that extends Frame. (will post code if required: lengthy). When the frame is resized/maximized, the splitPanes remain at their preferred size. How can I work on it such that the SplitPanes will resize proportionally too? Please inform me if I have overlooked certain details.
    -cyndi
    public class AppLayout {
         Frame parent;
         public AppLayout() {
         public void createSplitPanes( Panel messagePanel, TextArea messageAreaOut, TextArea messageAreaIn, TextArea messageArea ) {
              Panel splitPane2 = new SplitPane2( messageAreaOut, messageAreaIn, messageArea );
              messagePanel.setLayout( new GridLayout(1, 1));
              messagePanel.add(splitPane2);
         public class SplitPane2 extends Panel {
              public SplitPane2( TextArea messageAreaIn, TextArea messageAreaOut, TextArea messageArea ) {
                   //Create an instance of splitPane
                   splitPane sPane2  = new splitPane( messageAreaOut, messageAreaIn );
                   JSplitPane left    = sPane2.getSplitPane();
                   //XXXX: Bug #4131528, borders on nested split panes accumulate.
                   //Workaround: Set the border on any split pane within
                   //another split pane to null. Components within nested split
                   //panes need to have their own border for this to work well.
                   left.setBorder( null );
                   //Create a split pane and put "left" (a split pane)
                   //and TextArea instance in it.
                   JSplitPane sPane   = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT,
                        left, messageArea );
                   //splitPane.setOneTouchExpandable(true);
                   sPane.setDividerLocation( 150 );
                   sPane.setResizeWeight( 0.5 );
                   //Add the split pane to this frame
                   sPane.setPreferredSize( new Dimension( 400, 430 ) );
                   add( sPane );
              class splitPane {
                   JSplitPane sPane;
                   public splitPane( TextArea messageAreaOut, TextArea messageAreaIn ) {
                        //Read image names from a properties file
                        sPane = new JSplitPane( JSplitPane.VERTICAL_SPLIT,
                             messageAreaIn, messageAreaOut );
                        //splitPane.setOneTouchExpandable(true);
                        sPane.setDividerLocation( 0.5 );
                        sPane.setResizeWeight( 0.5 );
                        //Provide a preferred size for the split pane
                        sPane.setPreferredSize( new Dimension( 150, 350 ) );
                   public JSplitPane getSplitPane() {
                        return sPane;

    Hi, I'm not sure, but I think I had a similar problem. I tried to place a JSplitPane inside a JPanel and then I got the same behaviour as you describe. Unfortunately I didn't find out why that happened. I simply didn't use the JPanel and then it worked as I wanted it to. (Almost) :)

  • How to Split long string and fixed as per text hight in SSRS

    Hi,
    IF my report text is like aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    than text horizontally  coming like this only.
    but i have to write expression like it will be based on text width, means cut it down in next Row.
    Can Grow Property Is true for this Text.
    me using right now below Expression :--
    =iif(Len(Fields!Comment.Value) < 1000,Fields!Comment.Value, LEFT(Fields!Comment.Value,1000) &
    plz let me know the Solution .
    regards,
    Akhil

    Hi Akhil,
    In Reporting Services, if we set the CanGrow property of the textbox to True, than if the length of the text is too long, it will break into next line base on the width of the textbox. We needn't write expression to let the text break into next line
    manually.
    If you have any questions, please feel free to ask.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Can you hide the divider of a split pane ?

    I have a split pane, the application also has menu options that allow the user to turn off one of the panes if they like, this results in the pane disappearing but the splitpane divider still exists.
    Can this be removed, and if not is it acceptable look for the divider to exist when only one side of the splitpane is visible, or do I have to remove the splitpane from its parent and just add the visible component of the splitpane to the parent directly when only one is selected, reversing the code when user wishes to have both visible.

    Thanks that works fine. Although it is a shame there is no splitpane.getDivider() method, I assume there is no explicit guarantee that the LAF being used actually subclasses BasicSplitPaneUI, so I need to make appropriate checks.

  • I use "hdmi to component converter" to connect apple tv with my old plasma tv by component cable. Sound is ok but the picture split 2screens left and right. Still can't fix it. Anyone can help or has any idea? should I try convert to av?

    I use "hdmi to component converter" to connect apple tv with my old plasma tv by component cable. Sound is ok but the picture split 2screens left and right. Still can't fix it. Anyone can help or has any idea? should I try convert to av?

    Your TV hasn't entered some odd picture in picture mode has it with  two 'inputs' side by side?
    AC

  • I get the following message when i try to open ALL my documents : frozen panes and split panes are not supported and were removed. my documents are blank

    i get the following message when i try to open any of my documents : frozen panes and split panes are not supported and were removed. All my documents open blanc!

    Hi Louisa,
    louisa_16_za wrote:
    i work with Numbers on my MiniMac and then save the files as Excel because the university only works with Windows.
    Numbers is not an Excel clone. Importing and exporting between Numbers and Excel will eventually build up glitches.
    If the university only works with 'Windoze' it might be better if you use Excel or a free version of Office (for example, Libre Office or Open Office).
    If your marks depend upon a professor who uses Excel, go with the flow.
    http://www.howtogeek.com/187663/openoffice-vs.-libreoffice-whats-the-difference- and-which-should-you-use/
    Regards,
    Ian

  • Drag and drop icons from onside of the split pane to the other side.

    Hello All,
    I am tring to write a program where i can drag and drop icons from the left side of the split pane to the right side. I have to draw a network on the right side of the split pane from the icons provided on the left side. Putting the icons on the labels donot work as i would like to drag multiple icons from the left side and drop them on the right side. CAn anyone please help me with this.
    Thanks in advance
    smitha

    The other option besides the drag_n_drop support
    http://java.sun.com/docs/books/tutorial/uiswing/dnd/intro.htmlis to make up something on your own. You could use a glasspane (see JRootPane api for overview) as mentioned in the tutorial.
    Here's another variation using an OverlayLayout. One advantage of this approach is that you can localize the overlay component and avoid some work.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import javax.swing.event.MouseInputAdapter;
    public class DragRx extends JComponent {
        JPanel rightComponent;
        BufferedImage image;
        Point loc = new Point();
        protected void paintComponent(Graphics g) {
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            if(image != null)
                g2.drawImage(image, loc.x, loc.y, this);
        public void setImage(BufferedImage image) {
            this.image = image;
            repaint();
        public void moveImage(int x, int y) {
            loc.setLocation(x, y);
            repaint();
        public void dropImage(Point p) {
            int w = image.getWidth();
            int h = image.getHeight();
            p = SwingUtilities.convertPoint(this, p, rightComponent);
            JLabel label = new JLabel(new ImageIcon(image));
            rightComponent.add(label);
            label.setBounds(p.x, p.y, w, h);
            setImage(null);
        private JPanel getContent(BufferedImage[] images) {
            JSplitPane splitPane = new JSplitPane();
            splitPane.setLeftComponent(getLeftComponent(images));
            splitPane.setRightComponent(getRightComponent());
            splitPane.setResizeWeight(0.5);
            splitPane.setDividerLocation(225);
            JPanel panel = new JPanel();
            OverlayLayout overlay = new OverlayLayout(panel);
            panel.setLayout(overlay);
            panel.add(this);
            panel.add(splitPane);
            return panel;
        private JPanel getLeftComponent(BufferedImage[] images) {
            JPanel panel = new JPanel(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.weightx = 1.0;
            gbc.weighty = 1.0;
            for(int j = 0; j < images.length; j++) {
                gbc.gridwidth = (j%2 == 0) ? GridBagConstraints.RELATIVE
                                           : GridBagConstraints.REMAINDER;
                panel.add(new JLabel(new ImageIcon(images[j])), gbc);
            CopyDragHandler handler = new CopyDragHandler(panel, this);
            panel.addMouseListener(handler);
            panel.addMouseMotionListener(handler);
            return panel;
        private JPanel getRightComponent() {
            rightComponent = new JPanel(null);
            MouseInputAdapter mia = new MouseInputAdapter() {
                Component selectedComponent;
                Point offset = new Point();
                boolean dragging = false;
                public void mousePressed(MouseEvent e) {
                    Point p = e.getPoint();
                    for(Component c : rightComponent.getComponents()) {
                        Rectangle r = c.getBounds();
                        if(r.contains(p)) {
                            selectedComponent = c;
                            offset.x = p.x - r.x;
                            offset.y = p.y - r.y;
                            dragging = true;
                            break;
                public void mouseReleased(MouseEvent e) {
                    dragging = false;
                public void mouseDragged(MouseEvent e) {
                    if(dragging) {
                        int x = e.getX() - offset.x;
                        int y = e.getY() - offset.y;
                        selectedComponent.setLocation(x,y);
            rightComponent.addMouseListener(mia);
            rightComponent.addMouseMotionListener(mia);
            return rightComponent;
        public static void main(String[] args) throws IOException {
            String[] ids = { "-c---", "--g--", "---h-", "----t" };
            BufferedImage[] images = new BufferedImage[ids.length];
            for(int j = 0; j < images.length; j++) {
                String path = "images/geek/geek" + ids[j] + ".gif";
                images[j] = ImageIO.read(new File(path));
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.add(new DragRx().getContent(images));
            f.setSize(500,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class CopyDragHandler extends MouseInputAdapter {
        JComponent source;
        DragRx target;
        JLabel selectedLabel;
        Point start;
        Point offset = new Point();
        boolean dragging = false;
        final int MIN_DIST = 5;
        public CopyDragHandler(JComponent c, DragRx dr) {
            source = c;
            target = dr;
        public void mousePressed(MouseEvent e) {
            Point p = e.getPoint();
            Component[] c = source.getComponents();
            for(int j = 0; j < c.length; j++) {
                Rectangle r = c[j].getBounds();
                if(r.contains(p) && c[j] instanceof JLabel) {
                    offset.x = p.x - r.x;
                    offset.y = p.y - r.y;
                    start = p;
                    selectedLabel = (JLabel)c[j];
                    break;
        public void mouseReleased(MouseEvent e) {
            if(dragging && selectedLabel != null) {
                int x = e.getX() - offset.x;
                int y = e.getY() - offset.y;
                target.dropImage(new Point(x,y));
            selectedLabel = null;
            dragging = false;
        public void mouseDragged(MouseEvent e) {
            Point p = e.getPoint();
            if(!dragging && selectedLabel != null
                         && p.distance(start) > MIN_DIST) {
                dragging = true;
                copyAndSend();
            if(dragging) {
                int x = p.x - offset.x;
                int y = p.y - offset.y;
                target.moveImage(x, y);
        private void copyAndSend() {
            ImageIcon icon = (ImageIcon)selectedLabel.getIcon();
            BufferedImage image = copy((BufferedImage)icon.getImage());
            target.setImage(image);
        private BufferedImage copy(BufferedImage src) {
            int w = src.getWidth();
            int h = src.getHeight();
            BufferedImage dst =
                source.getGraphicsConfiguration().createCompatibleImage(w,h);
            Graphics2D g2 = dst.createGraphics();
            g2.drawImage(src,0,0,source);
            g2.dispose();
            return dst;
    }geek images from
    http://java.sun.com/docs/books/tutorial/uiswing/examples/components/index.html

  • Textpane does not fill up right comp of split pane

    I am a novice when it comes to swing. So please pardon me if the question I am sking is a bit silly.
    I have a split pane , with a resizable divider. the rightcomponent houses an internal frame used by for a JEditor Pane.
    How do I set the size for any new JEdiorpane , so it takes or fill up the right hand side of the split pane. Bearing in mind that the divider might have been moved so the right component area is not at the preffered size.
    Should I be using a listener to take note of the current size of the split pane component?
    Any advise wil be appreciated.

    Sounds like it might be a sync issue. Have you tried powering the monitor off and then back on with the MBP connected to it? How about just temporarily disconnecting the DVI cable from the desktop PC and using that to plug into the MBP.

  • Form pane X split pane

    I have an application with a JSplitPane in the center of the GUI.... in this split pane I have a left JTree and a right JPanel.
    on te JPanel on the right I have a form based on GridBagLyout, but it is very unstable... when I drag the split divider, sometimes te form becomes messy... with some fields over the other....
    some tip ?

    1 GridBagLayout is better than N-LayoutManagers ?Neither is better, which is why you have a choice. I prefer using whatever yields the easiest code to understand and maintain. For me this is usually a combination of the "basic" Layout Manager (ie. those Layout Managers without complex constraints)
    is that really necessary to adopt more than 1 LM ?I don't know, but you did ask the question because you are having problems using just a single Layout Manager.
    Either way there is no way we can offer specific advice because we have no idea what your form looks like.
    I suggest you read this before posting any further:
    http://www.physci.org/codes/sscce.jsp

  • Design problem(split pane scrollpane Insets)

    hi,
    doing a exam simulator prgm
    design is like,
    Question (text area with scrollpane)
    Answers (checkbox inside panel with scrollpane)
    used split pane between qst and ans but big thick bar comes how to reduce size and it is not
    moving.
    used GridLayout for container and panel.
    PROBLEM is how to leave space qst textarea appears from very left edge of screen how to leave some space
    same prblm for checkbox they to appear extreme left on screen.

    Put those components in a JPanel overwriting the getInsets() method like this:
    JPanel cPane=new JPanel(){
        private final Insets _insets=new Insets(10,10,10,10);
        public Insets getInsets(){
            return _insets;
    };...should do the trick, take a look at the Insets class if you need information on how defining it...

  • Split Pane Problem

    I have a panel with a split pane in it. On the Left hand side there is a Tree and on the right side is a complex tabbed pane.
    (complex meand it includes many panels, more tabbed panes and other components).
    My problem is this. I have given a specific width for the split pane for the tree and at start time it comes corrcetly. But when I move the Split pane left, suddenly it jumps to the left edge of the screen. And then I cant move it forward again. Tree cannot be seen now.
    Why does this happen I just cant figure out.
    Is it because of tabbed panes or something with the split pane.
    Another thing is when I try to move the split pane to the left the movements are not smooth. It kind of do smaller jumps, until it do that big jump to the edge.
    Any help would be greatly appreciated....

    Seeing that your file has a size of 3.5 Mb, I preferred not to download it, but to send you this link.

  • Splitting of Cost into Fixed & Variable

    Hi,
    In our current scenario there is only one cost and there is no split between them. Now my customer wants the cost to be split between fixed & variable. At present we are using KP26 to plan the cost. Here my cost will hit only one cost element (say A) at present. Requirement is to split this cost into fixed and variable and send to two separate cost elements (say B & C) for the same activity type and afterwards do the setllement accordinlgy.
    Can any one please guide me on how to achieve this.
    Thanks & Regards
    Sreekanth

    Hi,
    1.This can be achieved by creating two Activity types .eg AT1 for fixed, AT2 for the Variable.
    2. Do not assign the default Activity type in the Work center (Costing Tab)
    3. When you want to create the activity to capture the cost at fixed and variable level, create a single activity and assign two different activity elements e.g AT1 and AT1.
    Now for these two activitiy elements assign the resepctive work center and the activity type as per the need.
    4. This will capture the cost as requested by you.
    Hope it works for you, Please reward points if found useful.
    Thanks!

  • Why was the split pane removed from Acrobat?

    I recently upgraded from Acrobat 9 to Acrobat 11, and find that I'm not able to be as productive in 11. It's much harder to perform reviews because the Comment pane is difficult to work with. By default, the Comment pane is too narrow to be useful. If I undock it to try to put it underneath the document, I have to spend time fiddling with my windows to try to get the document the right size so that the undocked Comment pane can appear below it. The split pane was so much easier to work with; I hope that it will be added back in a future release. One other problem is that the scroll bar in the Comment pane is so narrow, it's difficult to click it.
    Can anyone suggest any workarounds to help deal with these new features?

    I tried the Touch Mode, which could probably help if I was viewing PDFs on a tablet, but unfortunately, it didn't do anything to increase the width of the Comment pane scroll bar, which is the UI element that I'm finding too narrow.
    I would have thought that Adobe's main customers would be using review and comment features heavily, so it's disappointing to see these types of UI changes made.
    As a workaround, I'm finding that I can at least split the page text, undock the Comment pane, and have it cover the bottom pane. That's a bit easier than trying to get it to fit under a resized main window. With most software that allows undocking, it usually lets you dock to a different spot, which would have worked fine here for those of us who would like to keep the comments at the bottom of the screen for better readability.

  • Activity variable and fixed price

    Planned
    Cost center 3104
    Cost element 4402 Activity (MACHIN) Category 1 Dependent Variable $.2000
    Planned Hours 100 in KP 26 for MACHIN
    Run distribution cycle Sender Common cost center to Receiver 3104 cost center
    Cost element 4402 value come on 3104 $.1000
    Run Assessment cycle Sender Common cost center to Receiver 3104 cost center
    Assessment Cost element AS4402 value come on 3104 $.500
    I run KSPI for calculation activity prices, result is
    MACHIN 2000/100 = 20 Variable
    MACHIN 1000/100 = 10 Fixed
    Q. Why system ignoring assessment cost?
    Q. I need system should calculate 3000+500/100 = 35 as Variable
    Regards
    Imdad Edited 26 Dec 08

    Hi Suraj
    Thanks for reply,
    Actually I have 5 activity types and all maintained equvelance number 1 for cost center/activitiy types.
    I am writing again my question.
    I have Chart of account having Variable and Fixed GLs separately. Some cost will be posted directly on production cost center via Variable and Fixed cost elements. Cost on common cost center will be allocated through Distribution and Assessment on Production cost centers. Client requirement is
    Prices for all 5 activities Variable & Fixed Separately. No proper solution was found and i planned cost activity dependent and result is OK in KSPI but allocated cost impact is zero. I have created a splitting structure and find that splitting is only possible for fixed price calculation.
    How i can calculate Variable and Fixed prices for all activities.
    Suraj hopefully you understand my problem. let me ur cell number i'll call u or e mail address i'll mail you screen shots.
    waiting for reply
    regards
    imdad
    i underscore bukhari at the rate of hotmail dot com

  • Pan No and PF account no displayed on payslip

    Hey guys,
    What are the steps I need to follow for the Pan no and PF account no to be displayed on the payslip?
    Regards,
    Ally

    Hi ,
    In the single feild window you can always mention the Table name P0185
    you need to go to the following config
    Go to Payroll> India> Forms> Remuneration statement --> Setting up forms with view( old proceduer)
    -->Setting up form> set up data in fixed postion and mention the feild inthe table as P0185-ICNUM
    Now go again to the PE 51 and check in single feilds
    Regards
    Hemant

Maybe you are looking for

  • Automatic Batch determination while creating outbound delivery

    Hi, I have already performed following steps, but still i am facing problem for Automatic Batch determination while creating outbound delivery : 1.CT01- Creation of Characteristics. ( Define Selection Class ) 2.CL01- change. ( Define Selection Class

  • Server tools not working on Snow Leopard

    I just upgraded my home Intel Mac Pro from 10.4 to 10.6, and downloaded the 10.6.4 Server tools from the website (WorkGroup manager, Server Admin, Server monitor, etc.). Our Xserve is 10.6.4 also, so there shouldn't be any incompatibility (like there

  • Option to Export as 720 or 1080 is drained?

    Im editing HD clips in iMovie 11 but when I go to Share>Export Movie, the 720P or 1080P options are usually drained. Sometimes 720P is available. I know if I export as Quicktime I can get around this usually but I still dont know what is causing this

  • Cost Center Group

    Hi all, Does anyone know where is the data for cost center group stored? Which table? Thanks and regards, sbmel.

  • Problem of h:selectOneMenu it is popping back to original value

    I have a dataTable in which one column is a <h:selectOneMenu> and the required attribute is false. There is a inputText in another column and the required attribute is true. Whenever I change the <h:selectOne> option to null (that is blank option) fr