JDesktop Web Component Crashing
- From: Foreal <galtschul@xxxxxxxxx>
- Date: Tue, 06 Nov 2007 22:03:28 -0000
I have a JTabbedPane with one tab that is a WebBrowser component that
is provided by JDIC. I would like to give the user the ability to move
the tabs position, but when I do this to this particular tab, JDIC
crashes: "JDesktop Integration Components binary has encountered a
problem and needs to close. We are sorry for the inconvenience.".
Here is the code that moves the tab:
public void moveTab(int direction) {
// get the current focused tab
int newTabPos, selectedTab = getSelectedIndex();
if (direction == MOVE_RIGHT) {
if (selectedTab == getTabCount() - 1)
return;
newTabPos = selectedTab + 1;
} else if (direction == MOVE_LEFT) {
if (selectedTab == 0)
return;
newTabPos = selectedTab - 1;
} else {
return;
}
// Get all the properties
Component comp = getComponentAt(selectedTab);
String label = getTitleAt(selectedTab);
Icon icon = getIconAt(selectedTab);
Icon iconDis = getDisabledIconAt(selectedTab);
String tooltip = getToolTipTextAt(selectedTab);
boolean enabled = isEnabledAt(selectedTab);
int keycode = getMnemonicAt(selectedTab);
int mnemonicLoc = getDisplayedMnemonicIndexAt(selectedTab);
Color fg = getForegroundAt(selectedTab);
Color bg = getBackgroundAt(selectedTab);
// Remove the tab
remove(selectedTab);
// Add a new tab
insertTab(label, icon, comp, tooltip, newTabPos);
// Restore all properties
setDisabledIconAt(newTabPos, iconDis);
setEnabledAt(newTabPos, enabled);
setMnemonicAt(newTabPos, keycode);
setDisplayedMnemonicIndexAt(newTabPos, mnemonicLoc);
setForegroundAt(newTabPos, fg);
setBackgroundAt(newTabPos, bg);
setSelectedIndex(newTabPos);
}
Thanks in advance for any help I get!!
Gregg
.
- Follow-Ups:
- Re: JDesktop Web Component Crashing
- From: Andrew Thompson
- Re: JDesktop Web Component Crashing
- Prev by Date: Re: Justifying box components
- Next by Date: Re: Justifying box components
- Previous by thread: Justifying box components
- Next by thread: Re: JDesktop Web Component Crashing
- Index(es):
Relevant Pages
|