Resize « Dialog « Java Swing Q&A





1. Detecting resizing of JDialog    stackoverflow.com

How can you detect when a JDialog has been resized? (WindowListener would have been my guess, but that doesn't seem to have a resizing event handler.)

2. Auto Resizing JScrollPane in JDialog    forums.netbeans.org

Hi, I have a JDialog built using NetBeans' Swing GUI Builder (using the default GroupLayout). (I'm using NetBeans 6.7.1) It contains a JScrollPane (containing a JTable) which I would like to ...

3. resize jdialog    coderanch.com

4. Dialog resize in SWT    coderanch.com

By the below code i am able to resize the dialog and composite but scroll bar is not coming. Please let me know how to get scrollbar. final GridLayout gridLayout = new GridLayout(); container.setLayout(gridLayout); //container.setLayout(new GridLayout(1,false)); final Composite composite = new Composite(container, SWT.NONE); final GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true); comp.addControlListener(new ControlAdapter() { public void controlResized(ControlEvent e) { Rectangle ...

5. JDialog resize question    coderanch.com

Hi I have a JDialog. I add components(label, buttons, checkbox, panel) to it. The panel holds a scrollpane with a jtable. The table contents change depending on the checkbox selection. The table shows 3 rows of data when the checkbox is not selected and 7 rows of data when the check box is selected. I do not want the vertical scroll ...

6. Resizing the JDialog when few fields are set invisible.    coderanch.com

X & Y are container-relative positions (correct me if I'm wrong here, the javadocs mention this being relative to "the parent" of the component) of the top-left corner, if you want to use the size of the components to change the size of dialog, you would be correct in using getWidth() and getHeight(). You could then subtract those values from the ...

7. JDialog Resize    coderanch.com

8. Resizing the JDialog only width not height    coderanch.com

Here's one way:import java.awt.*; import java.awt.event.*; import javax.swing.*; public class WidthResizeableDialog { Robot robot; static final int HEIGHT = 400; Point lastLocation; public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { new WidthResizeableDialog().makeUI(); } }); } public void makeUI() { try { robot = new Robot(); } catch (AWTException ex) { ex.printStackTrace(); } final JDialog dialog ...

9. my JDialog doesn't want to resize as I say :P    java-forums.org

Hi, I'm having trouble with a JDialog as I can't seem to be able to set its size. My application has a JFrame and a JDialog, and I've tried resizing the JDialog using the setSize() method and setMinimumSize(Dimension), but it still resizes automatically according to the components it has inside. My code goes like this: Java Code: public class Main { ...