No swing classes

2000-02-01 Thread Jack Jensen

I'm having a problem here with the swing classes.

All of the console apps and awt applets seem to be working alright,
but none of the applications or applets using  swing are compiling.

I'm new at this so it could be a config error somewhere, I've downloaded
the self-installing file from
3 different sites reinstalling it each time (after removing the previous
install) and the compiler still
says that No class def found for the swing methods.

Any help I can get would be appreciated.

Jack Jensen
[EMAIL PROTECTED]



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



re:No swing classes

2000-02-02 Thread Jack Jensen

The problem exists with any app I try to compile or run.

When compiling the SwingApplication.java program from Sun's swing
tutorial on-line I get the following:

SwingApplication.java:12: class JLabel not found in class
SwingApplication
final JLabel label = new JLabel(labelPrefix + "0");
  ^
SwingApplication.java:12: class JLabel not found in class
SwingApplication
final JLabel label = new JLabel(labelPrefix + "0");
 ^
SwingApplication.java:14: class JButton not found in class
SwingApplication
JButton button = new JButton("I'm a Swing button!");
^
SwingApplication.java:14: class JButton not found in class
SwingApplication
JButton button = new JButton("I'm a Swing button!");
 ^
SwingApplication.java:29: class JPanel not found in class
SwingApplication
JPanel pane = new JPanel();
^
SwingApplication.java:29: class JPanel not found in class
SwingApplication
JPanel pane = new JPanel();
  ^
SwingApplication.java:30: variable BorderFactory not found in class
SwingApplication
pane.setBorder(BorderFactory.createEmptyBorder(
   ^
SwingApplication.java:46: variable UIManager not found in class
SwingApplication
UIManager.getCrossPlatformLookAndFeelClassName());
^
SwingApplication.java:45: variable UIManager not found in class
SwingApplication
UIManager.setLookAndFeel(
^
SwingApplication.java:50: class JFrame not found in class
SwingApplication
JFrame frame = new JFrame("SwingApplication");
^
SwingApplication.java:50: class JFrame not found in class
SwingApplication
JFrame frame = new JFrame("SwingApplication");
   ^
11 errors

When I run this program :
--
// Fig. 2.8: Addition.java
// An addition program

import javax.swing.JOptionPane;  // import class JOptionPane

public class Addition {
   public static void main( String args[] )
   {
  String firstNumber,   // First string entered by
user
 secondNumber;  // Second dtring entered by
user
  intnumber1,   // First number to add
 number2,   // Second number to add
 sum;   // Sum of number1 and
number2

  // read in first number from user as a string
  firstNumber =
 JOptionPane.showInputDialog("Enter first integer" );

  // read in second number from user as a string
  secondNumber =
 JOptionPane.showInputDialog("Enter second integer" );

  // convert numbers from type String to type int
  number1 = Integer.parseInt( firstNumber );
  number2 = Integer.parseInt( secondNumber );

  // add the numbers
  sum = number1 + number2;

  // display the results
  JOptionePane.showMessageDialog(
 null, "The sum is " + sum, "Results",
 JOptionPane.PLAIN.MESSAGE );

  System.exit ( 0 );  // terminate the program
   }
}
--

I get the following:

at java.lang.Throwable..(Throwable.java:40)
at java.lang.Error.(Error.java:21)
at java.lang.LinkageError.(LinkageError.java:21)
at java.lang. NoClassDefFoundError.(NoClassDefFound Error.java:21)




--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: No swing classes

2000-02-02 Thread Jack Jensen

I'm using jdk1.2.2, I've tried the self-installing version from three
different mirrors sites,
and this morning I downloaded and installed the linux port(jdk1.2.2) tar
ball  from the Sun server.
I've set the JAVA_HOME variable to /mypath/jdk1.2.2
I haven't messed with the CLASSPATH because to tell the truth I don't
know what directory
the swing classes are in.

I'm using RedHat 6.1 on an AMDk6 II system, from what I've read in the
files with the
self-installing version it should have been a load and go install.

I am using gnome with Enlightenment window manager, but  this wouldn't
affect the compile
process would it?







--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: no swing classes

2000-02-05 Thread Jack Jensen

I want to thank everyone who sent me their help.

My problem was old java commands in the /usr/bin directory. The console
apps and non-swing apps ran
ok with these commands but they choked on the swing stuff. Removing them
and changing my PATH
solved the problem.

Thanks again

Jack Jensen


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]