Note that there are some explanatory texts on larger screens.

plurals
  1. POResizing issue with canvas within jscrollpane within jsplitpane
    primarykey
    data
    text
    <p>I'm creating an application using the NetBeans GUI Editor, in which I want to have a <code>JSplitPane</code>, the top component of which will be a <code>Canvas</code> within a <code>JScrollPane</code> and the bottom component will be a <code>JTextArea</code>, or something like that.</p> <p>When I pull the divider downwards, and thus increasing the size of the top component everything seem to resize just fine.</p> <p>The problem appears when I'm trying to push the divider upwards: The divider seems to go beneath the <code>Canvas</code> (and maybe beneath the <code>JScrollPane</code> too).</p> <p>I have tried various combinations of the preferred/minimum/maximum sizes of the <code>JScrollPane</code> and <code>Canvas</code> but nothing seems to work.</p> <p>This is the part of the code that Netbeans generated that may have something to do with the problem at hand:</p> <pre><code>jSplitPane1 = new javax.swing.JSplitPane(); jScrollPane1 = new javax.swing.JScrollPane(); canvas1 = new java.awt.Canvas(); jTextField1 = new javax.swing.JTextField(); jSplitPane1.setDividerLocation(300); jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); jScrollPane1.setViewportView(canvas1); jSplitPane1.setTopComponent(jScrollPane1); jTextField1.setText("jTextField1"); jSplitPane1.setRightComponent(jTextField1); </code></pre> <p>Since this is my first question, I'm not allowed to embed an image in the question, so I will just post the link:</p> <p><img src="https://i.stack.imgur.com/YXVsi.png" alt=""></p> <p>The red arrows indicate the position of the divider.</p> <p>Thanks in advance for your time.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload