Article View: borland.public.jbuilder.java.swing
Article #12687LookandFeel (Swing 1.1 Beta3)
From: Neil McLennan
Date: Thu, 26 Nov 1998 00:00
Date: Thu, 26 Nov 1998 00:00
44 lines
1885 bytes
1885 bytes
I wish to give the user the ability to the LookAndFeel at runtime. I wrote
the code to do this and all worked well under Swing 1.1 Beta2, but since the
class names in Swing 1.1 Beta3 have changed at compile time I get:
"reference to JFrame is ambiguous; both class com.sun.java.swing.JFrame in
package com.sun.java.swing and class javax.swing.JFrame in package
javax.swing match"
Can anybody give me a clue to what i am doing wrong?
(Class path for Swing 1.1 Beta3 is set as
D:\swing\swing-1.1beta3\swingall.jar)
Many Thanks,
Neil (new too Java programmer and JBuilder user)
import borland.jbcl.layout.*;
import javax.swing.*; // for MetalLookAndFeel
import com.sun.java.swing.*; // for WindowsLookAndFeel and MotifLookAndFeel
import java.awt.*;
import java.awt.event.*;
The UI selection code is as follows:
if (m_LAFJava.isSelected())
{
UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
}
else if (m_LAFWindows.isSelected())
{
UIManager.setLookAndFeel("com.sun.java.swing.windows.WindowsLookAndFeel");
else if (m_LAFMotif.isSelected())
{
UIManager.setLookAndFeel("com.sun.java.swing.motif.MotifLookAndFeel");
}
"reference to JFrame is ambiguous; both class com.sun.java.swing.JFrame in
package com.sun.java.swing and class javax.swing.JFrame in package
javax.swing match"
Technical Details
Message-ID:
<73japl$d5o1@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,bcc59f4bd74c1acb,start X-Google-Attributes: gid111d45,public From: "Neil McLennan" <N.McLennan@ic.ac.uk> Subject: LookandFeel (Swing 1.1 Beta3) Date: 1998/11/26 Message-ID: <73japl$d5o1@forums.borland.com> X-Deja-AN: 415853436 Organization: Another Netscape Collabra Server User X-MIMEOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Newsgroups: borland.public.jbuilder.java.swing