Skip to content

Commit 01ff1e6

Browse files
committed
Adds JSInternalFrame as JFrame
1 parent abe06ab commit 01ff1e6

File tree

7 files changed

+17
-421
lines changed

7 files changed

+17
-421
lines changed
-459 Bytes
Binary file not shown.

sources/net.sf.j2s.java.core/src/java/awt/Container.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ private void checkAddToSelf(Component comp){
428428
* Checks that the component is not a Window instance.
429429
*/
430430
private void checkNotAWindow(Component comp){
431-
if (comp instanceof Window) {
431+
if (comp instanceof Window && ((JSComponent) comp).getUIClassID() != "InternalFrameUI") {
432432
throw new IllegalArgumentException("adding a window to a container");
433433
}
434434
}

sources/net.sf.j2s.java.core/src/javax/swing/JFrame.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,12 +260,16 @@ public JFrame(String title) {
260260
*
261261
*/
262262
public JFrame(String title, GraphicsConfiguration gc) {
263+
this(title, gc, "FrameUI");
264+
}
265+
266+
public JFrame(String title, GraphicsConfiguration gc, String uiid) {
263267
initTitleGC(title, gc);
264268
enableEvents(AWTEvent.KEY_EVENT_MASK | AWTEvent.WINDOW_EVENT_MASK);
265269
setLocale(JComponent.getDefaultLocale());
266-
uiClassID = "FrameUI";
270+
uiClassID = uiid;
267271
setRootPane(createRootPane());
268-
rootPane.setFrameViewer(setFrameViewer(null));
272+
rootPane.setFrameViewer(setFrameViewer(null));
269273
setBackground(UIManager.getColor("control"));
270274
setRootPaneCheckingEnabled(true);
271275
if (JFrame.isDefaultLookAndFeelDecorated()) {

0 commit comments

Comments
 (0)