Where is javax.swing.GroupLayout Class....?

In the Java 6 Doc I am getting the information about javax.swing.GroupLayout class. But I cpuld not find the class in Jar.
Am I missing something?
It will be appriciated If you help me to finding the Jar file for this class.
Thanks.

Thanks for help.
I have got it. As I am using beta version of Java6 in which that class was missing. In the latest version of JDK , I have found that class.

Similar Messages

  • Javax.swing.GroupLayout - problem

    Hi
    Puzzling problem has occurred when developing the same application on different PC�s and using the same IDE (Netbeans 5.5) on both.
    The problem is that the �javax.swing.GroupLayout� class is being used when inserting netbeans GUI components on one of the PC�s. However, the other PC uses �org.jdesktop.layout.GroupLayout� and generates an error when trying to compile the �javax.swing.GroupLayout� components. It cannot find the javax.swing.GroupLayout� class.
    The jdk is jdk 6 for both.
    Can anyone shed any light on this?
    Regards
    GB

    Did you check the project properties?
    Project properties | Categories: Libraries --> Java Platform: JDK 1.6
    (javax.swing.GroupLayout works only with 1.6)

  • JDeveloper 11g javax.swing.GroupLayout

    Does JDeveloper 11g support the Swing class javax.swing.GroupLayout ?
    I did not see this class in the layout combo, and when I edited in the source code, I got an error:
    Field groupLayout not found in class oracle.jdevimpl.uieditor.proxy.JPanel
    Thanks a lot.
    John

    Hi,
    its a Java 6 feature and I am afraid to say that we didn't upgrade Swing to Java 6 in this release
    Frank

  • Where did javax.swing.plaf.metal go after 1.4?

    Dear Users of the java.swing libraries,
    I've made a schoolproject in javax.swing and i am using the javax.swing.plaf.metal.MetalLookAndFeel as LookAndFeel.
    The Problem is: it seems sun has removed the Metal LookAndFeel in versions past 1.4 or something like that. I read this in the source DefaultmetalTheme.java file:
    * This class describes the default Metal Theme.
    * <p>
    * <strong>Warning:</strong>
    * Serialized objects of this class will not be compatible with
    * future Swing releases. The current serialization support is
    * appropriate for short term storage or RMI between applications running
    * the same version of Swing.  As of 1.4, support for long term storage
    * of all JavaBeans<sup><font size="-2">TM</font></sup>
    * has been added to the <code>java.beans</code> package.
    * Please see {@link java.beans.XMLEncoder}.
    * @version 1.25 01/23/03
    * @author Steve Wilson
    */Now i wonder, can i find this cool Metal style anywhere else? In like the java.beans that was mentioned in the code of DefaultmetalTheme.java.
    In my current situation my project is ruined and i would relly appriciate some feedback on this!
    Yours Truthfully,
    Alexander Thore

    They would only be where you put them.
    You should be importing them to your computer regularly as you would with any digital camera, most especially before any update.
    If you failed to do this, then they are likely gone.
    You can try a restore from backup.

  • Javax.swing.GroupLayout

    Hi
    I have used Netbeans 7 to design my UI screens which uses jdk1.6, but i need to port it to jdk1.4..
    how can i make these changes?

    user7041221 wrote:
    I have used Netbeans 7 to design my UI screens which uses jdk1.6, but i need to port it to jdk1.4..
    how can i make these changes?Display the form in "Design" mode, right click the "Form" node in the "Inspector" window and set the property "Layout Generation Style" to "Swing Layout Extensions Library". Select the source level and java platform in the project properties window (File | Project Properties).
    Cheers,
    André

  • I cant see  GroupLayout in javax.swing.

    What i doing wrong?
    Thanks

    javax.swing.GroupLayout is since version 1.6.
    {color:#000080}If you are getting an error when trying to import the class, you have an earlier version of the jdk.
    If you cannot see the class in the documentation, you are referring to the documentation for an earlier version.{color}
    http://java.sun.com/javase/6/docs/api/javax/swing/GroupLayout.html
    {color:#000080}db{color}

  • Cannot find class javax.swing.JOptionPane

    Hello,
    I imported the class
    import javax.swing.JOptionPane;and written as a first line of my code in the form of a .java file.
    but error occurs as : cannot find the class javax.swing.JOptionPane. What should I do.
    Thank you.

    Are you doing something likeimport javax.swing.JOptionPane;
    class Test {
        public static void main(String args[]) {
            JOptionPane.showMessageDialog(null, "Testing",
                    "Testing", JOptionPane.INFORMATION_MESSAGE);
    }Mark

  • Newbie compiler help using javax.swing class

    current java ver java version "1.5.0_02"
    error msg
    [error]
    C:\Documents and Settings\Neil\Desktop\Java>javac neiltest2.java
    neiltest2.java:12: package javax does not exist
    import javax.swing;
    ^
    neiltest2.java:28: cannot resolve symbol
    symbol : variable JOptionPane
    location: class neiltest2
    JOptionPane.showMessageDialog(null, "The total is " + intSum);
    ^
    2 errors
    [error]
    * neiltest2.java
    * Created on 02 June 2005, 19:02
    * @author  Neil
    * @version
    import javax.swing;
    public class neiltest2 {
        /** Creates new neiltest2 */
        public neiltest2() {
        * @param args the command line arguments
        public static void main (String args[]) {
            int intSum;
            intSum = 14+35;
            JOptionPane.showMessageDialog(null, "The total is " + intSum);
            System.exit(0);
    }TIA
    Neil

    Use either
    import javax.swing.JOptionPanel;
    or
    import javax.swing.*;
    � {�                                                                                                                                                                               

  • Swing GroupLayout Error()

    Hello,
    I have an exception in my Japplet and i can`t find the problem. Can somebody find the exception.
    Thanks in advance
    Bart
    This is the exception:
    Exception in thread "main" java.lang.IllegalArgumentException: Component must be non-null
    at javax.swing.GroupLayout$ComponentSpring.<init>(GroupLayout.java:2878)
    at javax.swing.GroupLayout$ComponentSpring.<init>(GroupLayout.java:2858)
    at javax.swing.GroupLayout$Group.addComponent(GroupLayout.java:1490)
    at javax.swing.GroupLayout$ParallelGroup.addComponent(GroupLayout.java:2414)
    at javax.swing.GroupLayout$ParallelGroup.addComponent(GroupLayout.java:2384)
    at javax.swing.GroupLayout$Group.addComponent(GroupLayout.java:1471)
    at javax.swing.GroupLayout$ParallelGroup.addComponent(GroupLayout.java:2406)
    My Code:
    package gui;
    import javax.swing.*;
    import java.awt.*;
    public class Gui extends JPanel {
        * File:         Gui.java
        * Version:      1.0
        * Description:  The Gui of a simple spot editing tool for the web.
        * @author       Bart
        * Date:         30-10-2008
        @SuppressWarnings("unchecked")
        private JButton btnPost;
        private JLabel lblSpotter;
        private JLabel lblDatum;
        private JLabel lblTijd;
        private JLabel lblVogelsoort;
        private JLabel lblLocation;
        private JLabel lblFoto;
        private JLabel lblCommentaar;
        private JLabel sl1;
        private JLabel sl2;
        private JLabel dp1;
        private JTextField inputSpotter;
        private JTextField inputDag;
        private JTextField inputUur;
        private JTextField inputVogelsoort;
        private JTextField inputMaand;
        private JTextField inputJaar;
        private JTextField inputMin;
        private JTextField inputLocAB;
        private JTextField inputLoc1234;
        private JTextField inputLoc5678;
        private JTextArea inputCommentaar;
        private JScrollPane jScrollPane1;
         * Method: Constructor Gui
         * Description:
        public Gui() {
         * Method: Constructor Gui
         * Description:
        private void init() {
            this.setVisible(true);
         //buttons
         btnPost = new JButton("Verzend");
         //labels
         lblSpotter = new JLabel("Spotter: ");
            lblDatum = new JLabel("Datum: ");
            lblTijd = new JLabel("Tijd: ");
            lblVogelsoort = new JLabel("Vogelsoort: ");
            lblLocation = new JLabel("Location: ");
            lblCommentaar = new JLabel("Commentaar: ");
            sl1 = new JLabel("/");
            sl2 = new JLabel("/");
            dp1 = new JLabel(":");
         //textfields & areas & scrollpane
         inputSpotter = new JTextField();
            inputDag = new JTextField();
            inputUur = new JTextField();
            inputVogelsoort = new JTextField();
            inputMaand = new JTextField();
            inputJaar = new JTextField();
            inputMin = new JTextField();
            inputLocAB = new JTextField();
            inputLoc1234 = new JTextField();
            inputLoc5678 = new JTextField();
            inputCommentaar = new JTextArea();
            inputCommentaar.setColumns(20);
            inputCommentaar.setRows(5);
         jScrollPane1 = new JScrollPane();
            jScrollPane1.setViewportView(inputCommentaar);
         //grouplayout & adding labels,textfields,textareas to layout
            GroupLayout layout = new GroupLayout(this);
            this.setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                        .addComponent(lblCommentaar)
                        .addGroup(layout.createSequentialGroup()
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                                .addComponent(lblVogelsoort)
                                .addComponent(lblLocation)
                                .addComponent(lblTijd)
                                .addComponent(lblDatum)
                                .addComponent(lblSpotter)))
                        .addComponent(lblFoto))
                    .addGap(7, 7, 7)
                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING, false)
                        .addGroup(GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
                                .addComponent(inputDag)
                                .addComponent(inputUur, GroupLayout.DEFAULT_SIZE, 57, Short.MAX_VALUE))
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                                .addComponent(sl1)
                                .addComponent(dp1))
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
                                .addComponent(inputMin, GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE)
                                .addComponent(inputMaand))
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(sl2)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(inputJaar))
                        .addComponent(jScrollPane1, GroupLayout.Alignment.LEADING)
                        .addGroup(GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                            .addComponent(inputLocAB, GroupLayout.PREFERRED_SIZE, 53, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(inputLoc1234, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(inputLoc5678))
                        .addComponent(inputSpotter, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 189, Short.MAX_VALUE)
                        .addComponent(inputVogelsoort, GroupLayout.Alignment.LEADING)
                        .addComponent(btnPost))
                    .addContainerGap(31, Short.MAX_VALUE))
            layout.setVerticalGroup(
                layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addGap(26, 26, 26)
                            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                                .addComponent(lblDatum)
                                .addComponent(inputDag, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                .addComponent(inputMaand, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                .addComponent(inputJaar, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                .addComponent(inputLocAB)
                                .addComponent(inputLoc1234)))
                        .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                            .addComponent(lblSpotter)
                            .addComponent(inputSpotter, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(lblTijd)
                        .addComponent(inputUur, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                        .addComponent(inputMin, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                        .addComponent(dp1))
                    .addGap(7, 7, 7)
                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(lblVogelsoort)
                        .addComponent(inputVogelsoort, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(lblLocation)
                        .addComponent(inputLocAB, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                        .addComponent(inputLoc1234, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                        .addComponent(inputLoc5678, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                        .addComponent(lblCommentaar)
                        .addComponent(jScrollPane1, GroupLayout.PREFERRED_SIZE, 78, GroupLayout.PREFERRED_SIZE))
                    .addGap(6, 6, 6)
                    .addComponent(lblFoto)
                    .addGap(21, 21, 21)
                    .addComponent(btnPost)
                    .addContainerGap())
          * Method: Start
          * Description:
         public void start() {
          * Method: Stop
          * Description:
         public void Stop() {
          * Method: Destroy
          * Description:
         public void destroy() {
         public static void main(String args[]){
              Gui gui = new Gui();
                    gui.init();
    }

    I`ve changed JPanel into JApplet and init() into go() ,and start(),destroy() and stop() are disabled.
    But at the end i want to have the applet into a webbrowser. And i can`t find the error, GroupLayout layout - new GroupLayout(this) seems good in my vision. The error is on the "this" part, is it possible to give the this a value?
    Complete Exception
    Exception in thread "main" java.lang.IllegalArgumentException: Component must be non-null
            at javax.swing.GroupLayout$ComponentSpring.<init>(GroupLayout.java:2878)
            at javax.swing.GroupLayout$ComponentSpring.<init>(GroupLayout.java:2858)
            at javax.swing.GroupLayout$Group.addComponent(GroupLayout.java:1490)
            at javax.swing.GroupLayout$ParallelGroup.addComponent(GroupLayout.java:2414)
            at javax.swing.GroupLayout$ParallelGroup.addComponent(GroupLayout.java:2384)
            at javax.swing.GroupLayout$Group.addComponent(GroupLayout.java:1471)
            at javax.swing.GroupLayout$ParallelGroup.addComponent(GroupLayout.java:2406)
            at gui.Gui.init(Gui.java:98)
            at gui.Gui.main(Gui.java:212)
    Java Result: 1Thanks in advance,
    Bart

  • AAARGH!!! Can't understand javax.swing.text.*

    Good afternoon...
    does anybody understand javax.swing.text classes? i've read a number of
    books, downloaded docs (including those from the javax.swing.text author), and googled everything i could think of. but nothing seems to explain it to me so that i can understand it! maybe i'm just dense, but maybe it really is that difficult.
    i want to create a read-only document, who's source is not necessarily a
    string, but perhaps an ArrayList of objects with a HashMap of attributes. or even something simpler for now, just an object with a fixed number of attributes. i want to display this information in a JTextArea. i tried implementing a Document and passing it to the JTextArea constructor but just got a NullPointerException.
    does anybody know where i can find more information on creating my own
    document types?
    here's the code for my ReadOnlyDocument class if anyone of you are generous (& adventurous) enough to take a look:
    import java.util.ArrayList;
    import javax.swing.event.DocumentListener;
    import javax.swing.event.UndoableEditListener;
    import javax.swing.text.AttributeSet;
    import javax.swing.text.BadLocationException;
    import javax.swing.text.Document;
    import javax.swing.text.Element;
    import javax.swing.text.Position;
    import javax.swing.text.Segment;
    public class ReadOnlyDocument implements Document{
        private String myContent = "this is the contents of my document!";
        private ArrayList listeners;
        private ReadOnlyDocument refSelf = this;
        public ReadOnlyDocument() {
         System.out.println("ReadOnlyDocument.<init>");
        public int getLength() {
         System.out.println("ReadOnlyDocument.getLength() = " + myContent.length());
            return myContent.length();
        public void addDocumentListener(DocumentListener listener) {
         System.out.println("ReadOnlyDocument.addDocumentListener(" + listener + ")");
            if (listeners != null) {
                listeners = new ArrayList();
                listeners.add(listener);
            } else {
                listeners = new ArrayList();
                listeners.add(listener);
        public void removeDocumentListener(DocumentListener listener) {
         System.out.println("ReadOnlyDocument.removeDocumentListener(" +
    listener + ")");
            if (listeners != null) {
                listeners.remove(listener);
        public void addUndoableEditListener(UndoableEditListener listener) {
            // Read-only document, nothing to do here
         System.out.println("ReadOnlyDocument.addUndoableEditListener(" +
    listener + ")");
        public void removeUndoableEditListener(UndoableEditListener listener) {
            // Read-only document, nothing to do here
         System.out.println("ReadOnlyDocument.removeUndoableEditListener(" +
    listener + ")");
        public Object getProperty(Object key) {
            System.out.println("ReadOnlyDocument.getProperty(" + key + ") =
    null");
            return null;
        public void putProperty(Object key, Object value) {
               System.out.println("ReadOnlyDocument.putProperty(" + key + ")");
        public void remove(int offs, int len) throws BadLocationException {
            // Read-only document, nothing to do here
         System.out.println("ReadOnlyDocument.remove(" + offs + ", " + len +
        public void insertString(int offset, String str, AttributeSet a) throws
    BadLocationException {
            // Read-only document, nothing to do here
         System.out.println("ReadOnlyDocument.insertString(" + offset + ", " +
    str + ", " + a + ")");
        public String getText(int offset, int length) throws
    BadLocationException {
         System.out.print("ReadOnlyDocument.getText(" + offset + ", " + length +
    ") = ");
            if ((offset >= 0) && (length >= 0) && (offset+length <=
    myContent.length()+1)) {
             System.out.println(myContent.substring(offset, offset+length-1));
                return myContent.substring(offset, offset+length-1);
            } else {
             System.out.println("BadLocationException!");
                throw new BadLocationException("Bad location requested", 0);
        public void getText(int offset, int length, Segment txt) throws
    BadLocationException {
         System.out.print("ReadOnlyDocument.getText(" + offset + ", " + length +
    ", " + txt + ") = ");
            if ((offset >= 0) && (length >= 0) && (offset+length <=
    myContent.length()+1)) {
             System.out.println(myContent.substring(offset, offset+length-1));
                txt = new Segment(myContent.toCharArray(), offset, length);
            } else {
             System.out.println("BadLocationException!");
                throw new BadLocationException("Bad location requested", 0);
        public Position getStartPosition() {
         System.out.println("ReadOnlyDocument.getStartPosition() = 0");
      return new Position() {
       public int getOffset() {
        return 0;
        public Position getEndPosition() {
         System.out.println("ReadOnlyDocument.getEndPosition() = " +
    myContent.length());
      return new Position() {
       public int getOffset() {
        return myContent.length();
        public Position createPosition(int offs) throws BadLocationException {
         System.out.println("ReadOnlyDocument.createPosition(" + offs + ") =
    0");
            if ((offs >= 0) && (offs <= myContent.length()-1)) {
       return new Position() {
        public int getOffset() {
         return 0;
      } else {
       throw new BadLocationException("Bad location requested", 0);
        public Element[] getRootElements() {
         System.out.println("ReadOnlyDocument.getRootElements()");
         Element[] roots = {new Element() {
       public Document getDocument() {
        return refSelf;
       public Element getParentElement() {
        return null;
       public String getName() {
        return "ReadOnlyRoot";
       public AttributeSet getAttributes() {
        return null;
       public int getStartOffset() {
        return 0;
       public int getEndOffset() {
        return myContent.length() - 1;
       public int getElementIndex(int offset) {
        return 0;
       public int getElementCount() {
        return 0;
       public Element getElement(int index) {
        return null;
       public boolean isLeaf() {
        return true;
      return roots;
        public Element getDefaultRootElement() {
         System.out.println("ReadOnlyDocument.getDefaultRootElement()");
      return new Element() {
       public Document getDocument() {
        return refSelf;
       public Element getParentElement() {
        return null;
       public String getName() {
        return "ReadOnlyRoot";
       public AttributeSet getAttributes() {
        return null;
       public int getStartOffset() {
        return 0;
       public int getEndOffset() {
        return myContent.length() - 1;
       public int getElementIndex(int offset) {
        return 0;
       public int getElementCount() {
        return 0;
       public Element getElement(int index) {
        return null;
       public boolean isLeaf() {
        return true;
        public void render(Runnable r) {
            // not sure what to put here
         System.out.println("ReadOnlyDocument.render(" + r + ")");
    }and here's a simple class to display the document/generate the error:
    import java.awt.event.*;
    import javax.swing.*;
    public class ReadOnlyFrame extends JFrame {
    public ReadOnlyFrame() {
      super();
      setTitle("Read Only Document");
      addWindowListener(new WindowAdapter() {
       public void windowClosed(WindowEvent e) {
        System.exit(0);
      getContentPane().add(new JTextArea(new ReadOnlyDocument()));
      setSize(200, 200);
    public static void main(String[] args) {
      ReadOnlyFrame rof = new ReadOnlyFrame();
      rof.setVisible(true);
    Headed for the second star to the right and straight on till morning...
    Eric Schultz
    aka: Storkman
    http://community.webshots.com/user/storky1
    mailto:EricSchultzATcanadaDOTcom

    if you are getting that print before the timer
    starts, then I'd expect it's not blocking. The
    problem with these small snippets of code is that we
    can't really tell what might be going on elsewhere.Yes, I realize that. AAMOF, there isn't anything going on elsewhere, i.e.
    the GestureController object spawns another thread when it gets
    created. That other thread blocks until a 'Mover' object is delivered to
    the GestureController object. The mutex/synchronizing stuff works
    like the textbook version, i.e. no deadlock, no deadly embrace, no
    nothing. When the timer is started, the Mover is supposed to
    call back the 'animate' method, just a method in the GestureController
    object.
    All the System.out.prints show that it gets there. The task (an ActionListener)
    dispatched by that timer doesn't start. As you can see above, I've
    used System.out.prints for that too. It is as if that Timer doesn't start.
    I still haven't found anything ... This is what the 'auto.move' thing is
    supposed to do:     static class DragMover implements Mover {
              DrawableStack from;
              DrawableStack to;
              int position;
              DragMover(DrawableStack from, int position, DrawableStack to) {
                   this.from= from;
                   this.to  = to;
                   this.position= position;
              public void move() {
                   System.out.println("moving the stuff...");
                   GestureController.getGestureController().animate(from, position, to);
              public void undo() { }          
         }... the line "moving stuff ..." isn't displayed either, i.e. the actionPerformed
    method is never called and then ... there's nothing in between there, i.e.
    the Timer is supposed to call that method.
    Thank you for your reply, much appreciated and,
    kind regards,
    Jos
    by that timer (an ActionListener)

  • Javaclassnotfound javax.swing.JPanel in a applet

    Hi,
    I have a applet which use a class which have the code
    import javax.swing.JPanel;
    public class WebPanel extends JPanel implements Runnable{
    Applet parent;
    i compile it with jdk1.2.2
    my problem is that when i try to run the applet on a Internet Explorer navigator it give me a
    javaclassnotfound javax.swing.JPanel
    problem.
    Javax.swing.JPanel is�nt in IExploter?
    Should i put the javax.swing.Jpanel class in the jar fije?
    Where i can find it?
    Thanks in advance.

    forgot to mention this...get the plug in here:
    http://java.sun.com/products/plugin/
    read the intstructions, u might have to do some 'applet conversion' ....u'll know what I mean when u install the plugin
    good luck

  • Javax.swing.JFileChooser -- open button change current directory... Why?

    Hello community.
    I use javax.swing.JFileChooser class. After press open button, JFileChooser change current directory. Why?
    I was not find in documentation about changing curret directiry by JFileChooser. Take me please reference to doc for understanding this effect.
    Thank you.

    This is my code:
    private void jFileChooser1ActionPerformed(java.awt.event.ActionEvent evt) {                                             
    // TODO add your handling code here:
    // label1.setText("3: "+evt.);
    // label1.setText("3: ");
    label1.setText(evt.getActionCommand());
    System.out.println(evt.getActionCommand());
    if (evt.getActionCommand().startsWith("Approve")){
    label1.setText("You push Open key");
    System.out.println(jFileChooser1.getCurrentDirectory().getPath());
    label1.setText(jFileChooser1.getCurrentDirectory().getPath());
    }else{
    label1.setText("You push Close key");
    I not add method for change current directory. But after press on open button javax.swing.JFileChooser class was change current directory.

  • Javax.swing.*  - vs - javax.swing.JTable - any tradeoff?

    I'm new to java and have noticed that sometimes people write:
    import javax.swing.*;and sometimes they write
    import javax.swing.JTable;Is there a performance hit using the first example? Any info on this or pointers to relevant web pages would be greatly appreciated.
    Thanks,
    Matt

    No, there is no performance hit between the two options. The difference lies in readablity and name spaces. Some people prefer to use java.package.* when importing for ease in coding, but it is ambiguous and does not give much information on specific classes used which can hurt readablity. In terms of name spaces using .* can be detrimental. For instance if you were creating a GUI using swing components and imported javax.swing.* That would also give you access to javax.swing.Box class, and if you had your own package with a Box class call my.package.Box which you also imported there would be conflicts in which class would be refrenced. So it can be benifical to explicitly state your imports.

  • Variable textArea not found in class javax.swing.JFrame...

    Making progress on this issue -- but still stuck. Again trying to get the text from a JTextArea on exit:
            frame.addWindowListener
           (new WindowAdapter() {
             public void windowClosing(WindowEvent e)
                System.out.println("Why me???" + frame.textArea.getText());
            });User MARSIAN helped me understand the scope fo the variables and now that has been fixed. Unfortunately I cannot access my variable textArea in the above code. If get this error:
    Error: variable textArea not found in class javax.swing.JFrame
    What am I doing wrong?
    import  java.net.*;
    import  javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import FragImpl.*;
    public class Framework extends WindowAdapter {
        public int numWindows = 0;
        private Point lastLocation = null;
        private int maxX = 500;
        private int maxY = 500;
        JFrame frame;
        public Framework() {
            newFrag();
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
            maxX = screenSize.width - 50;
            maxY = screenSize.height - 50;
            makeNewWindow();
        public void makeNewWindow() {
            frame = new MyFrame(this);  //*
            numWindows++;
            System.out.println("Number of windows: " + numWindows);
            if (lastLocation != null) {
                //Move the window over and down 40 pixels.
                lastLocation.translate(40, 40);
                if ((lastLocation.x > maxX) || (lastLocation.y > maxY)) {
                    lastLocation.setLocation(0, 0);
                frame.setLocation(lastLocation);
            } else {
                lastLocation = frame.getLocation();
            System.out.println("Frame location: " + lastLocation);
            frame.setVisible(true);
            frame.addWindowListener
           (new WindowAdapter() {
             public void windowClosing(WindowEvent e)
                System.out.println("Why me???" + frame.textArea.getText());
        //This method must be evoked from the event-dispatching thread.
        public void quit(JFrame frame) {
            if (quitConfirmed(frame)) {
                System.exit(0);
            System.out.println("Quit operation not confirmed; staying alive.");
        private boolean quitConfirmed(JFrame frame) {
            String s1 = "Quit";
            String s2 = "Cancel";
            Object[] options = {s1, s2};
            int n = JOptionPane.showOptionDialog(frame,
                    "Windows are still open.\nDo you really want to quit?",
                    "Quit Confirmation",
                    JOptionPane.YES_NO_OPTION,
                    JOptionPane.QUESTION_MESSAGE,
                    null,
                    options,
                    s1);
            if (n == JOptionPane.YES_OPTION) {
                return true;
            } else {
                return false;
         private void newFrag()
              Frag frag = new FragImpl();
        public static void main(String[] args) {
            Framework framework = new Framework();
    class MyFrame extends JFrame {
        protected Dimension defaultSize = new Dimension(200, 200);
        protected Framework framework = null;
        private Color color = Color.yellow;
        private Container c;
        JTextArea textArea;
        public MyFrame(Framework controller) {
            super("New Frame");
            framework = controller;
            setDefaultCloseOperation(DISPOSE_ON_CLOSE);
            setSize(defaultSize);
            //Create a text area.
            textArea = new JTextArea(
                    "This is an editable JTextArea " +
                    "that has been initialized with the setText method. " +
                    "A text area is a \"plain\" text component, " +
                    "which means that although it can display text " +
                    "in any font, all of the text is in the same font."
            textArea.setFont(new Font("Serif", Font.ITALIC, 16));
            textArea.setLineWrap(true);
            textArea.setWrapStyleWord(true);
            textArea.setBackground ( Color.yellow );
            JScrollPane areaScrollPane = new JScrollPane(textArea);
            //Create the status area.
            JPanel statusPane = new JPanel(new GridLayout(1, 1));
            ImageIcon icoOpen = null;
            URL url = null;
            try
                icoOpen = new ImageIcon("post_it0a.gif"); //("doc04d.gif");
            catch(Exception ex)
                ex.printStackTrace();
                System.exit(1);
            setIconImage(icoOpen.getImage());
            c = getContentPane();
            c.setBackground ( Color.yellow );
            c.add ( areaScrollPane, BorderLayout.CENTER )  ;
            c.add ( statusPane, BorderLayout.SOUTH );
            c.repaint ();
    }

    Yeah!!! It works. Turned out to be a combination of DrKlap's and Martisan's suggestions -- had to change var frame's declaration from JFrame to MyFrame:
        MyFrame frame;Next, created the external class -- but again changed JFrame references to MyFrame:
    public class ShowOnExit extends WindowAdapter {
    //   JFrame aFrame;
       MyFrame aFrame;
       public ShowOnExit(MyFrame f) {
          aFrame = f;
       public void windowClosing(WindowEvent e)
          System.out.println("Why me???" + aFrame.textArea.getText()); // aFrame here not frame !!!
    }This worked. So looks like even though the original code added a WindowListener to 'frame', the listener didn't couldn't access frame's methods unless it was explicitly passed in as a parameter. Let me know if that's wrong.
    Thanks again, all.

  • Missing classes from the javax.swing package?

    Can anyone throw any light on what appears to be a missing class from the javax.swing package?
    When CelsiusConverter.java from The Swing Tutorial (code fragment shown below) is compiled the JFrame class can't be found.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class CelsiusConverter implements ActionListener {
        JFrame converterFrame;Despite the package javax.swing being imported, the compiler does not seem to be be able to find the JFrame class.
    CelsiusConverter.java:14: Class JFrame not found in type declaration.
        JFrame converterFrame;To attempt to solve this issue all the files in jdk1.5.0_02\lib were added to CLASSPATH.
    CLASSPATH was set to C:\Program Files\Java\jdk1.5.0_02\lib\dt.jar;C:\Program Files\Java\jdk1.5.0_02\lib\htmlconverter.jar;C:\Program Files\Java\jdk1.5.0_02\lib\jconsole.jar;C:\Program Files\Java\jdk1.5.0_02\lib\tools.jar;C:\Program Files\Java\jdk1.5.0_02\lib;C:\Program Files\Java\jdk1.5.0_02\lib\ir.idl;C:\Program Files\Java\jdk1.5.0_02\lib\jawt.lib;C:\Program Files\Java\jdk1.5.0_02\lib\jvm.lib;C:\Program Files\Java\jdk1.5.0_02\lib\orb.idl;C:\Program Files\Java\jdk1.5.0_02\demo\jfc\SwingApplet\SwingApplet.jar;.;c:\CoreJavaBook

    This is extremely strange... If you're sure it's not a problem in your code or with your classpath, the only other thing I can think to suggest is re-downloading / installing java

Maybe you are looking for

  • CER upgrade from 8.6 to 10.5- Refresh Upgrade COP file

    I am looking for the RU COP file specific to CER  10.5,  there is no COP file available under CER 10.5 download section . There is a COP file available under 10.0 ( v1) that is only for RHEL 5. Version 1.5 COP file available only for CUCM/CUC/IMP Can

  • Attribute ADDR_SHIPT Ship to address

    Hi, I have a problem I cannot resolve that for some of my users the Ship to address number has been maintained in the attributes in PPOMA_BBP so that the user has a default delivery address. However, no matter what we do the ship to address is not de

  • D-Bus: How can root access a user's started session?

    D-Bus is really useful for automating a lot of tasks, and I want it to respond to certain ACPI events using a acpid configuration. However, acpid runs as root, and it seems like root cannot find or access a logged in user's D-Bus session. Example: #

  • Itunes says my digital copy code has been used already.

    Got star trek for blu-ray. It came with a digital copy and a redeem code. However when I entered it on the redeem page in itunes a red message appears telling me the code has been used once and can not be used again. The code is from a fully sealed n

  • Production Versions- storage location

    Hi All Material A0001 is an in-house product in my company, and the material [A0001] is also issued as a component for other Finshed Good [A000FG] inhouse product. Actually the scenario is User expects the A0001 material to automatically GR at in-tra