Error Package Javax .swing Does Not Exist
off-topic or offensive (we know it when we see it), but not always before they are indexed by search engines. Check out a list of the available forums at: http://www.artima.com/index.jsp Search the content of the Artima Forums at: http://www.artima.com/forums/search.jsp Web Artima.com Copyright © 1996-2016 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us
mgangav Member Registered: 2009-04-18 Posts: 21 [Solved] CLASSPATH for javax.swing libraries? Hello,I wanted to use the swing packages provided by java for developing cross platform GUIs. But, when I tried compiling it, I ended up with the following error:HelloWorldSwing.java:1: package javax does not exist import javax.swing;After searching a bit online, I found out that the CLASSPATH variable needed to be set to use external java libraries. (I installed the jdk and jre packages). I tried setting CLASSPATH to /opt/java/jre/lib in my ~/.bashrc but that didn't help. What should I do to http://www.artima.com/forums/flat.jsp?forum=1&thread=28461 remedy this situation?(This is the first time that I am trying to use external libraries like swing on Arch. So I am a Noob at this)Thanks for your time! Last edited by mgangav (2009-11-24 15:45:59) Offline #2 2009-11-24 02:22:51 urist Member Registered: 2009-02-22 Posts: 248 Re: [Solved] CLASSPATH for javax.swing libraries? All I did was add /opt/java/bin and /opt/java/jre/bin (not sure https://bbs.archlinux.org/viewtopic.php?id=85465 if it's required) to my PATH and set JAVA_HOME to /opt/java/jre and swing works just fine for me.I'm unsure if any of this helps, though. Last edited by urist (2009-11-24 02:24:50) Offline #3 2009-11-24 15:01:15 mgangav Member Registered: 2009-04-18 Posts: 21 Re: [Solved] CLASSPATH for javax.swing libraries? urist wrote:All I did was add /opt/java/bin and /opt/java/jre/bin (not sure if it's required) to my PATH and set JAVA_HOME to /opt/java/jre and swing works just fine for me.I'm unsure if any of this helps, though.Thanks for your reply! But, for some reason, this hasn't helped me. Do you think that there are some special package that I have to install. Do you have a CLASS_PATH variable? Offline #4 2009-11-24 15:13:24 peart Member From: Kanuckistan Registered: 2003-07-28 Posts: 510 Re: [Solved] CLASSPATH for javax.swing libraries? mgangav,If your line of code really reads "import javax.swing", then that is the problem, not the classpath. After installing the JDK, all you have to do is log out and back in to get a proper classpath for Swing applications.What you should do in your code is im
This Site Careers Other all forums Forum: Swing / AWT / SWT Unable to use swing libraries Vinnibabu singu Ranch Hand Posts: 30 posted 7 years https://coderanch.com/t/462928/GUI/java/Unable-swing-libraries ago I installed jdk 1.6 in my system. I am able to practice all the other concepts. When i tried to compile a swing program it gave an error specifying that Couldnt find the class and package Do we need to install any additional software or to set any classpath in order to do a swing programme? error package Rob Spoor Sheriff Posts: 20695 68 I like... posted 7 years ago Can you show us the full error message? SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6 How To Ask Questions How To Answer Questions Vinnibabu singu Ranch Hand Posts: 30 posted 7 years ago package java.swing does not exist import error package javax java.swing.*; package java.swing.border does not exist import java.swing.border.*; pete stein Bartender Posts: 1561 posted 7 years ago Vinnibabu singu wrote:package java.swing does not exist import java.swing.*; package java.swing.border does not exist import java.swing.border.*; That's because it is import javax.swing.*; don't forget the "x" Campbell Ritchie Sheriff Posts: 50490 82 posted 7 years ago Spelling error. It's "javax.swing.XXX" Vinnibabu singu Ranch Hand Posts: 30 posted 7 years ago thank you so much. Actually there was a mistake in the notes i was refering. thanks for the clarification Campbell Ritchie Sheriff Posts: 50490 82 posted 7 years ago You're welcome Post Reply Bookmark Topic Watch Topic New Topic Similar Threads I want to design a java class (standalone) which will read Data from HTML page.Is it possible?? java swing plugin for ecplise Eclipse Plug-in for Swing application development suggestion Highlight color All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter Contact Us | advertise | mobile view | Powered by JForum | Copyright © 1998-2016 Paul Wheaton