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 / General / April 2006

Tip: Looking for answers? Try searching our database.

Using JTabbedPane from Mustang with 1.5 JRE

Thread view: 
bruces1@gmail.com - 24 Apr 2006 02:06 GMT
Hi all,

I would like to use one particular class from Mustang in my app:
JTabbedPane. The latest version allows custom components to be added to
the tabs themselves.

I found a thread in the JBuilder group
(http://groups.google.com/group/borland.public.jbuilder.ide/browse_thread/thread/
88bce292b6f5e109/63e00e6dd9b59a40#63e00e6dd9b59a40
)
That pointed me in the right direction. I imported the JTabbedPane
source into my project and compiled my app, which includes a call to
one of the new methods of the Mustang version,
JTabbedPane.setTabComponentAt().

The resulting class file is output in the same place as the rest of my
classes, and packaged into a .jar file .

However, at runtime, with the jar file in the classpath, Java seems to
use the 1.5 version of JTabbedPane from the JRE:

java.lang.NoSuchMethodError:
javax.swing.JTabbedPane.setTabComponentAt(ILjava/awt/Component;)V

Does this sound correct? If so, how can I "override" the 1.5 version
with the Mustang version when running the app?

I have posted a similar question in the JBuilder group last week, but
over the weekend I figured it's more of a general Java question.

Thank you,

Bruce Sutherland.
Venkatesh - 24 Apr 2006 06:56 GMT
I'm guessing that an older version of jvm is running ....

Generally, the following variables should be set properly: PATH,
JAVA_HOME and CLASSPATH. (If more than one version of java is installed
in ur machine, then make sure that the PATH variable has the
directories of latest version of java at the beggining)

If u r running ur JVM from command prompt, Just try "java -version" and
see if proper version of JVM is running.

The exception you are getting is because of incompatible class version.

-Venkatesh
bruces1@gmail.com - 24 Apr 2006 09:15 GMT
Thanks for the reply Venkatesh.

I don't think I explained clearly enough. I do want to use the 1.5 JRE,
with the exception of JTabbedPane (and the several inner classes
belonging to it) from Mustang.

Bruce.
Thomas Weidenfeller - 24 Apr 2006 09:46 GMT
> I don't think I explained clearly enough. I do want to use the 1.5 JRE,
> with the exception of JTabbedPane (and the several inner classes
> belonging to it) from Mustang.

I am not a lawyer but I would be surprised if the Mustang or the 1.5
license allows this at all. Before starting with the technical bits you
might want to study both licenses intensively.

/Thomas
Signature

The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/

bruces1@gmail.com - 24 Apr 2006 10:03 GMT
This is a good point Thomas.

Can anybody suggest an LGPLed or BSD licensed class that will give me
tabbed panes with close buttons? Preferably an implementation that
allows you to add components the tabs, similar to the Mustang
JTabbedPane.

Closeable tabs exist in JBuilder and Azureus to name two apps that I
know of. I'm pretty sure JBuilder doesn't use Mustang.

I found some hacks that extend JTabbedPane, none of which I
particularly like. For example, one modifies the paint function to
paint the close button, but then you can't add a MouseListener to do
things like change the colour when the mouse hovers over it. Another
problem with this method is that when you click the "close button", the
tabbed pane displays the tab content before closing it.

Thanks.

Bruce.


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.