JInternalFrame - illegal component position
up vote
0
down vote
favorite
java 1.7
public class AccountsScroller extends JInternalFrame implements ActionListener, PaginationListener {
...
}
Here how I open InternalFrame from JFrame
public void openInternalFrame(JInternalFrame newInternalFrame, Boolean isMaximize, Dimension dimension) {
try {
currentInternalFrame.setClosed(true);
currentInternalFrame = newInternalFrame;
addInternalFrame(currentInternalFrame, isMaximize, dimension);
} catch (PropertyVetoException ex) {
logger.error(ex.getMessage(), ex);
}
}
private JDesktopPane desktop;
desktop = new JDesktopPane();
private void addInternalFrame(JInternalFrame internalFrame, Boolean isMaximize, Dimension dimension) {
desktop.add(internalFrame); // 321 line
try {
internalFrame.setSelected(true);
if (isMaximize != null && isMaximize) {
internalFrame.setMaximum(true);
} else {
internalFrame.setSize(dimension);
}
} catch (java.beans.PropertyVetoException e) {
logger.error(e.getMessage(), e);
}
}
But when I again open it I get error:
[java] get_all_accounts rows = 2
[java] Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: illegal component position
[java] at java.awt.Container.addImpl(Container.java:1100)
[java] at javax.swing.JLayeredPane.addImpl(JLayeredPane.java:231)
[java] at javax.swing.JDesktopPane.addImpl(JDesktopPane.java:484)
[java] at java.awt.Container.add(Container.java:417)
[java] at myproject.com.MainScreenView.addInternalFrame(MainScreenView.java:321)
[java] at myproject.com.MainScreenView.openInternalFrame(MainScreenView.java:314)
[java] at myproject.com.MainScreenView.openInternalFrame(MainScreenView.java:307)
[java] at myproject.com.MainScreenView.actionPerformed(MainScreenView.java:230)
[java] at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
[java] at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
[java] at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
[java] at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
[java] at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
[java] at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
[java] at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
[java] at java.awt.Component.processMouseEvent(Component.java:6533)
[java] at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
[java] at java.awt.Component.processEvent(Component.java:6298)
[java] at java.awt.Container.processEvent(Container.java:2236)
[java] at java.awt.Component.dispatchEventImpl(Component.java:4889)
[java] at java.awt.Container.dispatchEventImpl(Container.java:2294)
[java] at java.awt.Component.dispatchEvent(Component.java:4711)
[java] at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
[java] at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
[java] at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
[java] at java.awt.Container.dispatchEventImpl(Container.java:2280)
[java] at java.awt.Window.dispatchEventImpl(Window.java:2746)`enter code here`
java swing illegalargumentexception jinternalframe
add a comment |
up vote
0
down vote
favorite
java 1.7
public class AccountsScroller extends JInternalFrame implements ActionListener, PaginationListener {
...
}
Here how I open InternalFrame from JFrame
public void openInternalFrame(JInternalFrame newInternalFrame, Boolean isMaximize, Dimension dimension) {
try {
currentInternalFrame.setClosed(true);
currentInternalFrame = newInternalFrame;
addInternalFrame(currentInternalFrame, isMaximize, dimension);
} catch (PropertyVetoException ex) {
logger.error(ex.getMessage(), ex);
}
}
private JDesktopPane desktop;
desktop = new JDesktopPane();
private void addInternalFrame(JInternalFrame internalFrame, Boolean isMaximize, Dimension dimension) {
desktop.add(internalFrame); // 321 line
try {
internalFrame.setSelected(true);
if (isMaximize != null && isMaximize) {
internalFrame.setMaximum(true);
} else {
internalFrame.setSize(dimension);
}
} catch (java.beans.PropertyVetoException e) {
logger.error(e.getMessage(), e);
}
}
But when I again open it I get error:
[java] get_all_accounts rows = 2
[java] Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: illegal component position
[java] at java.awt.Container.addImpl(Container.java:1100)
[java] at javax.swing.JLayeredPane.addImpl(JLayeredPane.java:231)
[java] at javax.swing.JDesktopPane.addImpl(JDesktopPane.java:484)
[java] at java.awt.Container.add(Container.java:417)
[java] at myproject.com.MainScreenView.addInternalFrame(MainScreenView.java:321)
[java] at myproject.com.MainScreenView.openInternalFrame(MainScreenView.java:314)
[java] at myproject.com.MainScreenView.openInternalFrame(MainScreenView.java:307)
[java] at myproject.com.MainScreenView.actionPerformed(MainScreenView.java:230)
[java] at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
[java] at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
[java] at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
[java] at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
[java] at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
[java] at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
[java] at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
[java] at java.awt.Component.processMouseEvent(Component.java:6533)
[java] at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
[java] at java.awt.Component.processEvent(Component.java:6298)
[java] at java.awt.Container.processEvent(Container.java:2236)
[java] at java.awt.Component.dispatchEventImpl(Component.java:4889)
[java] at java.awt.Container.dispatchEventImpl(Container.java:2294)
[java] at java.awt.Component.dispatchEvent(Component.java:4711)
[java] at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
[java] at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
[java] at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
[java] at java.awt.Container.dispatchEventImpl(Container.java:2280)
[java] at java.awt.Window.dispatchEventImpl(Window.java:2746)`enter code here`
java swing illegalargumentexception jinternalframe
1
Post an Minimal, Complete, and Verifiable example that demonstrates the problem.
– camickr
Nov 10 at 20:03
MainScreenView.java:321
BTW - an MCVE of this problem should be Complete in much less than 321 lines of code.
– Andrew Thompson
Nov 10 at 23:04
I update my post: desktop.add(internalFrame);
– Alexei
Nov 11 at 8:09
Tip: Add @camickr (or whoever, the@
is important) to notify the person of a new comment. "I update my post:" Why didn't you wait till there was an MCVE before updating the post (with it)? I won't be giving this serious thought until I have code that compiles & runs.
– Andrew Thompson
Nov 12 at 1:03
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
java 1.7
public class AccountsScroller extends JInternalFrame implements ActionListener, PaginationListener {
...
}
Here how I open InternalFrame from JFrame
public void openInternalFrame(JInternalFrame newInternalFrame, Boolean isMaximize, Dimension dimension) {
try {
currentInternalFrame.setClosed(true);
currentInternalFrame = newInternalFrame;
addInternalFrame(currentInternalFrame, isMaximize, dimension);
} catch (PropertyVetoException ex) {
logger.error(ex.getMessage(), ex);
}
}
private JDesktopPane desktop;
desktop = new JDesktopPane();
private void addInternalFrame(JInternalFrame internalFrame, Boolean isMaximize, Dimension dimension) {
desktop.add(internalFrame); // 321 line
try {
internalFrame.setSelected(true);
if (isMaximize != null && isMaximize) {
internalFrame.setMaximum(true);
} else {
internalFrame.setSize(dimension);
}
} catch (java.beans.PropertyVetoException e) {
logger.error(e.getMessage(), e);
}
}
But when I again open it I get error:
[java] get_all_accounts rows = 2
[java] Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: illegal component position
[java] at java.awt.Container.addImpl(Container.java:1100)
[java] at javax.swing.JLayeredPane.addImpl(JLayeredPane.java:231)
[java] at javax.swing.JDesktopPane.addImpl(JDesktopPane.java:484)
[java] at java.awt.Container.add(Container.java:417)
[java] at myproject.com.MainScreenView.addInternalFrame(MainScreenView.java:321)
[java] at myproject.com.MainScreenView.openInternalFrame(MainScreenView.java:314)
[java] at myproject.com.MainScreenView.openInternalFrame(MainScreenView.java:307)
[java] at myproject.com.MainScreenView.actionPerformed(MainScreenView.java:230)
[java] at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
[java] at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
[java] at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
[java] at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
[java] at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
[java] at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
[java] at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
[java] at java.awt.Component.processMouseEvent(Component.java:6533)
[java] at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
[java] at java.awt.Component.processEvent(Component.java:6298)
[java] at java.awt.Container.processEvent(Container.java:2236)
[java] at java.awt.Component.dispatchEventImpl(Component.java:4889)
[java] at java.awt.Container.dispatchEventImpl(Container.java:2294)
[java] at java.awt.Component.dispatchEvent(Component.java:4711)
[java] at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
[java] at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
[java] at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
[java] at java.awt.Container.dispatchEventImpl(Container.java:2280)
[java] at java.awt.Window.dispatchEventImpl(Window.java:2746)`enter code here`
java swing illegalargumentexception jinternalframe
java 1.7
public class AccountsScroller extends JInternalFrame implements ActionListener, PaginationListener {
...
}
Here how I open InternalFrame from JFrame
public void openInternalFrame(JInternalFrame newInternalFrame, Boolean isMaximize, Dimension dimension) {
try {
currentInternalFrame.setClosed(true);
currentInternalFrame = newInternalFrame;
addInternalFrame(currentInternalFrame, isMaximize, dimension);
} catch (PropertyVetoException ex) {
logger.error(ex.getMessage(), ex);
}
}
private JDesktopPane desktop;
desktop = new JDesktopPane();
private void addInternalFrame(JInternalFrame internalFrame, Boolean isMaximize, Dimension dimension) {
desktop.add(internalFrame); // 321 line
try {
internalFrame.setSelected(true);
if (isMaximize != null && isMaximize) {
internalFrame.setMaximum(true);
} else {
internalFrame.setSize(dimension);
}
} catch (java.beans.PropertyVetoException e) {
logger.error(e.getMessage(), e);
}
}
But when I again open it I get error:
[java] get_all_accounts rows = 2
[java] Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: illegal component position
[java] at java.awt.Container.addImpl(Container.java:1100)
[java] at javax.swing.JLayeredPane.addImpl(JLayeredPane.java:231)
[java] at javax.swing.JDesktopPane.addImpl(JDesktopPane.java:484)
[java] at java.awt.Container.add(Container.java:417)
[java] at myproject.com.MainScreenView.addInternalFrame(MainScreenView.java:321)
[java] at myproject.com.MainScreenView.openInternalFrame(MainScreenView.java:314)
[java] at myproject.com.MainScreenView.openInternalFrame(MainScreenView.java:307)
[java] at myproject.com.MainScreenView.actionPerformed(MainScreenView.java:230)
[java] at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
[java] at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
[java] at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
[java] at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
[java] at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
[java] at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
[java] at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
[java] at java.awt.Component.processMouseEvent(Component.java:6533)
[java] at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
[java] at java.awt.Component.processEvent(Component.java:6298)
[java] at java.awt.Container.processEvent(Container.java:2236)
[java] at java.awt.Component.dispatchEventImpl(Component.java:4889)
[java] at java.awt.Container.dispatchEventImpl(Container.java:2294)
[java] at java.awt.Component.dispatchEvent(Component.java:4711)
[java] at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
[java] at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
[java] at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
[java] at java.awt.Container.dispatchEventImpl(Container.java:2280)
[java] at java.awt.Window.dispatchEventImpl(Window.java:2746)`enter code here`
java swing illegalargumentexception jinternalframe
java swing illegalargumentexception jinternalframe
edited Nov 11 at 8:09
asked Nov 10 at 18:36
Alexei
1,039923
1,039923
1
Post an Minimal, Complete, and Verifiable example that demonstrates the problem.
– camickr
Nov 10 at 20:03
MainScreenView.java:321
BTW - an MCVE of this problem should be Complete in much less than 321 lines of code.
– Andrew Thompson
Nov 10 at 23:04
I update my post: desktop.add(internalFrame);
– Alexei
Nov 11 at 8:09
Tip: Add @camickr (or whoever, the@
is important) to notify the person of a new comment. "I update my post:" Why didn't you wait till there was an MCVE before updating the post (with it)? I won't be giving this serious thought until I have code that compiles & runs.
– Andrew Thompson
Nov 12 at 1:03
add a comment |
1
Post an Minimal, Complete, and Verifiable example that demonstrates the problem.
– camickr
Nov 10 at 20:03
MainScreenView.java:321
BTW - an MCVE of this problem should be Complete in much less than 321 lines of code.
– Andrew Thompson
Nov 10 at 23:04
I update my post: desktop.add(internalFrame);
– Alexei
Nov 11 at 8:09
Tip: Add @camickr (or whoever, the@
is important) to notify the person of a new comment. "I update my post:" Why didn't you wait till there was an MCVE before updating the post (with it)? I won't be giving this serious thought until I have code that compiles & runs.
– Andrew Thompson
Nov 12 at 1:03
1
1
Post an Minimal, Complete, and Verifiable example that demonstrates the problem.
– camickr
Nov 10 at 20:03
Post an Minimal, Complete, and Verifiable example that demonstrates the problem.
– camickr
Nov 10 at 20:03
MainScreenView.java:321
BTW - an MCVE of this problem should be Complete in much less than 321 lines of code.– Andrew Thompson
Nov 10 at 23:04
MainScreenView.java:321
BTW - an MCVE of this problem should be Complete in much less than 321 lines of code.– Andrew Thompson
Nov 10 at 23:04
I update my post: desktop.add(internalFrame);
– Alexei
Nov 11 at 8:09
I update my post: desktop.add(internalFrame);
– Alexei
Nov 11 at 8:09
Tip: Add @camickr (or whoever, the
@
is important) to notify the person of a new comment. "I update my post:" Why didn't you wait till there was an MCVE before updating the post (with it)? I won't be giving this serious thought until I have code that compiles & runs.– Andrew Thompson
Nov 12 at 1:03
Tip: Add @camickr (or whoever, the
@
is important) to notify the person of a new comment. "I update my post:" Why didn't you wait till there was an MCVE before updating the post (with it)? I won't be giving this serious thought until I have code that compiles & runs.– Andrew Thompson
Nov 12 at 1:03
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
draft saved
draft discarded
draft saved
draft discarded
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53242187%2fjinternalframe-illegal-component-position%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Post an Minimal, Complete, and Verifiable example that demonstrates the problem.
– camickr
Nov 10 at 20:03
MainScreenView.java:321
BTW - an MCVE of this problem should be Complete in much less than 321 lines of code.– Andrew Thompson
Nov 10 at 23:04
I update my post: desktop.add(internalFrame);
– Alexei
Nov 11 at 8:09
Tip: Add @camickr (or whoever, the
@
is important) to notify the person of a new comment. "I update my post:" Why didn't you wait till there was an MCVE before updating the post (with it)? I won't be giving this serious thought until I have code that compiles & runs.– Andrew Thompson
Nov 12 at 1:03