-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.1.6
-
sparc
-
solaris_2.6
If a user sets the width or height of a Frame or Dialog to a size greater than the Frame Buffer capabilites then it will try and draw it the dialog/frame to that size. Now if the user tries to resize the window it will try and recalculate the width/height. If the numbers are large enough the redraw will
throw the new size off the screen. User will think the program crashed when
in fact the window is drawn off the screen.
This is an OpenWindows issue only. CDE works fine. In CDE Dialogs and Frames are
not allowed to draw outside the scope of the window region.
Run following program to see the effects of described problem.
import java.awt.*;
import java.awt.event.*;
class DialogResizable extends Frame implements ItemListener, ActionListener {
Button but1 = new Button("Passed");
Button but2 = new Button("Failed");
Panel control2 = new Panel();
DialogResizable() {
super("setResizable Example");
Checkbox cb = new Checkbox("Resizable", null, isResizable());
cb.addItemListener(this);
add(cb, BorderLayout.NORTH);
but1.setBackground(Color.green);
but1.addActionListener(this);
but2.setBackground(Color.red);
but2.addActionListener(this);
control2.add(but1);
control2.add(but2);
add("Center",new Label("Are you able to resize/not resize based on choice selected."));
add("South", control2);
validate();
setSize(3000,300); //bug clips to frame / dialog width
setVisible(true);
}
public void actionPerformed(ActionEvent event) {
if (event.getSource() == but1) {
System.out.println("Test for Dialog.setResizable Passed");
System.exit(0);
}
else if (event.getSource() == but2) {
System.out.println("Test for Dialog.setResizable Failed");
System.exit(1);
}
}
public void itemStateChanged(ItemEvent evt) {
setResizable(evt.getStateChange() == ItemEvent.SELECTED);
}
static public void main(String[] args) {
new DialogResizable();
}
}
throw the new size off the screen. User will think the program crashed when
in fact the window is drawn off the screen.
This is an OpenWindows issue only. CDE works fine. In CDE Dialogs and Frames are
not allowed to draw outside the scope of the window region.
Run following program to see the effects of described problem.
import java.awt.*;
import java.awt.event.*;
class DialogResizable extends Frame implements ItemListener, ActionListener {
Button but1 = new Button("Passed");
Button but2 = new Button("Failed");
Panel control2 = new Panel();
DialogResizable() {
super("setResizable Example");
Checkbox cb = new Checkbox("Resizable", null, isResizable());
cb.addItemListener(this);
add(cb, BorderLayout.NORTH);
but1.setBackground(Color.green);
but1.addActionListener(this);
but2.setBackground(Color.red);
but2.addActionListener(this);
control2.add(but1);
control2.add(but2);
add("Center",new Label("Are you able to resize/not resize based on choice selected."));
add("South", control2);
validate();
setSize(3000,300); //bug clips to frame / dialog width
setVisible(true);
}
public void actionPerformed(ActionEvent event) {
if (event.getSource() == but1) {
System.out.println("Test for Dialog.setResizable Passed");
System.exit(0);
}
else if (event.getSource() == but2) {
System.out.println("Test for Dialog.setResizable Failed");
System.exit(1);
}
}
public void itemStateChanged(ItemEvent evt) {
setResizable(evt.getStateChange() == ItemEvent.SELECTED);
}
static public void main(String[] args) {
new DialogResizable();
}
}