From 6f98d8f58f98827ae454c7ce4839de4071d95767 Mon Sep 17 00:00:00 2001
From: Harshitha Onkar
- +
+
Select the different options for the Frame:
- Do the above steps for all the different Frame state combinations available.
- If you observe the proper behavior the test has passed, Press the Pass button.
- Otherwise the test has failed, Press the Fail button.
+ Do the above steps for all the different Frame state combinations
+ available.
+ For "Hide, Iconify and Show" case, the frame is hidden then iconified
+ hence Window2 is not seen on-screen when shown as the frame is still
+ in the ICONIFIED state. Window2 is visible on-screen when it is restored
+ to NORMAL state as observed with "Hide, Iconify, Show and Restore" case.
+
+
+ If you observe the proper behavior for all the combinations,
+ press PASS else FAIL.
Note: In Frame State Test (Window2) you can also chose the different
buttons to see different Frame behavior.
An example of a problem that
@@ -106,9 +101,9 @@ public class FrameStateTest implements ActionListener {
Button btnDispose = new Button("Dispose Frame");
CheckboxGroup cbgState = new CheckboxGroup();
CheckboxGroup cbgResize = new CheckboxGroup();
- Checkbox cbIconState = new Checkbox("Frame state ICONIFIED", cbgState, true);
- Checkbox cbNormState = new Checkbox("Frame state NORMAL", cbgState, false);
- Checkbox cbNonResize = new Checkbox("Frame non-resizable", cbgResize, false);
+ Checkbox cbIconState = new Checkbox("Frame State ICONIFIED", cbgState, true);
+ Checkbox cbNormState = new Checkbox("Frame State NORMAL", cbgState, false);
+ Checkbox cbNonResize = new Checkbox("Frame Non-Resizable", cbgResize, false);
Checkbox cbResize = new Checkbox("Frame Resizable", cbgResize, true);
CreateFrame icontst;
@@ -116,12 +111,12 @@ public class FrameStateTest implements ActionListener {
public static void main(String[] args) throws Exception {
PassFailJFrame
.builder()
- .title("GetBoundsResizeTest Instructions")
+ .title("Frame State and Size Test Instructions")
.instructions(INSTRUCTIONS)
.testTimeOut(10)
- .rows(25)
+ .rows(27)
.columns(70)
- .logArea(10)
+ .logArea(6)
.splitUIBottom(() -> new FrameStateTest().createPanel())
.build()
.awaitAndCheck();
@@ -149,7 +144,7 @@ public class FrameStateTest implements ActionListener {
if (evt.getSource() == btnCreate) {
btnCreate.setEnabled(false);
btnDispose.setEnabled(true);
- icontst =new CreateFrame(cbIconState.getState(), cbResize.getState());
+ icontst = new CreateFrame(cbIconState.getState(), cbResize.getState());
icontst.setVisible(true);
} else if (evt.getSource() == btnDispose) {
btnCreate.setEnabled(true);
@@ -166,7 +161,7 @@ public class FrameStateTest implements ActionListener {
String name = "Frame State Test";
CreateFrame(boolean iconified, boolean resizable) {
- setTitle("Frame State Test (Window 2)");
+ setTitle("Test Window (Window 2)");
isResizable = resizable;
@@ -175,13 +170,13 @@ public class FrameStateTest implements ActionListener {
((isResizable) ? "RESIZABLE" : "NON-RESIZABLE"));
setLayout(new FlowLayout());
- add(b1 = new Button("resizable"));
- add(b2 = new Button("resize"));
- add(b3 = new Button("iconify"));
- add(b4 = new Button("iconify and restore"));
- add(b5 = new Button("hide and show"));
- add(b6 = new Button("hide, iconify and show"));
- add(b7 = new Button("hide, iconify, show, and restore"));
+ add(b1 = new Button("Resizable"));
+ add(b2 = new Button("Resize"));
+ add(b3 = new Button("Iconify"));
+ add(b4 = new Button("Iconify and Restore"));
+ add(b5 = new Button("Hide and Show"));
+ add(b6 = new Button("Hide, Iconify and Show"));
+ add(b7 = new Button("Hide, Iconify, Show and Restore"));
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
@@ -191,10 +186,9 @@ public class FrameStateTest implements ActionListener {
b7.addActionListener(this);
addWindowListener(this);
- setBounds(100, 2, 200, 200);
+ setBounds(100, 2, 300, 200);
setState(iconified ? Frame.ICONIFIED : Frame.NORMAL);
setResizable(isResizable);
- pack();
setVisible(true);
}
@@ -320,11 +314,11 @@ public class FrameStateTest implements ActionListener {
public void stateLog(String message) {
PassFailJFrame
- .log("[State=%d] %s %s".formatted(getState(), name, message));
+ .log("[Current State = %d] %s %s".formatted(getState(), name, message));
}
public void stateLog() {
- PassFailJFrame.log("[State=" + getState() + "]");
+ PassFailJFrame.log("[Current State = " + getState() + "]");
}
}
}