Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / November 2007

Tip: Looking for answers? Try searching our database.

JDesktop Web Component Crashing

Thread view: 
Foreal - 06 Nov 2007 22:03 GMT
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
Andrew Thompson - 07 Nov 2007 09:28 GMT
> 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.".

Sure.  Did you hava a question, or were you just making
a comment?

If 'asking a question' - you might try adding one in future.

In any case, I recommend the following course of
action to debug the code.
1) Prepare an example that does not involve the JDesktop
classes and also crashes, and post it here as an SSCCE
with a question attached.
2) If you can prepare an example as decribed in 1) but
it does *not* crash, that supports that the problem lies
within the JDesktop classes, in which case you should
probably 'tell someone that cares' - where that 'someone'
would probably be listenning on the JDesktop forums.

Andrew T.
Foreal - 08 Nov 2007 15:21 GMT
> > I have a JTabbedPane with one tab that is a WebBrowsercomponentthat
> > is provided by JDIC. I would like to give the user the ability to move
[quoted text clipped - 19 lines]
>
> Andrew T.

I'm sorry Andrew, but do I need to include a question mark to make my
question more obvious? If so, here are few sample questions that would
have fit: "Has anyone else experienced this?", "Has anyone else fixed
this?", etc. And further, I think it's fairly obvious that I'm only
getting this error with JDIC, otherwise my post would have been more
generic; perhaps something along the lines of "I crash whenever I am
trying to move a tab" would have done fine. Regardless, you did take
the time to respond (albeit with a smart-a.s, holier-than-thou
response typical of those who have spent their entire lives talking to
people (or perhaps just machines) on im rather than in person), and
for that I am eternally grateful.
Andrew Thompson - 09 Nov 2007 01:35 GMT
>> > I have a JTabbedPane with one tab that is a WebBrowsercomponent
...
>I'm sorry Andrew, but do I need to include a question mark to make my
>question more obvious? If so, here are few sample questions that would
[quoted text clipped - 6 lines]
>response typical of those who have spent their entire lives talking to
>people (or perhaps just machines) on im rather than in person), ...

I note that amongst all that self indulgent whining, there is no
indication you followed either of my suggestions.

>..and
>for that I am eternally grateful.

(shrugs)  'No worries.'

Signature

Andrew Thompson
http://www.athompson.info/andrew/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.