📄 windowforframetest.java
字号:
package org.uispec4j;
import junit.framework.AssertionFailedError;
import org.uispec4j.utils.AssertionFailureNotDetectedError;
import javax.swing.*;
import java.awt.*;
public class WindowForFrameTest extends WindowTestCase {
public void testIsModal() throws Exception {
Window window = new Window(new Frame());
assertFalse(window.isModal());
try {
assertTrue(window.isModal());
throw new AssertionFailureNotDetectedError();
}
catch (AssertionFailedError e) {
}
}
public void testWindowManagesMenuBars() throws Exception {
Window window = new Window(new Frame());
try {
window.getMenuBar();
throw new AssertionFailureNotDetectedError();
}
catch (AssertionFailedError e) {
assertEquals("This component has no menu bar", e.getMessage());
}
}
protected Window createWindowWithMenu(JMenuBar jMenuBar) {
return null;
}
protected Window createWindowWithTitle(String title) {
return new Window(new Frame(title));
}
protected void close(Window window) {
Frame frame = (Frame)window.getAwtContainer();
frame.dispose();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -