Strange behaviour of JBuilder Plug-In with Inner class

Hi, I'm using the Kodo 2.5.2 Plug-In with JBuilder 8. I have an inner
persistent class. It seems that it is necessary to have a zero length file
named EnclosingClass$InnerClass.java for the build process to work, since
if I delete this file and run the application it throws an exception
saying that the Inner class has not an specified field which it really
has. I don't know if this is a bug of the Kodo implementation or of the
JBuilder Plug-In.
Thanks for any help.
Jaime.

This is one of the limitations of the JBuilder plugin. Hopefully it
will be resolved in the next iteration of our plugins for 3.x.
Jaime De La Jara F. wrote:
Hi, I'm using the Kodo 2.5.2 Plug-In with JBuilder 8. I have an inner
persistent class. It seems that it is necessary to have a zero length file
named EnclosingClass$InnerClass.java for the build process to work, since
if I delete this file and run the application it throws an exception
saying that the Inner class has not an specified field which it really
has. I don't know if this is a bug of the Kodo implementation or of the
JBuilder Plug-In.
Thanks for any help.
Jaime.
Steve Kim
[email protected]
SolarMetric Inc.
http://www.solarmetric.com

Similar Messages

  • Problems with inner classes in JasminXT

    I hava problems with inner classes in JasminXT.
    I wrote:
    ;This is outer class
    .source Outer.j
    .class Outer
    .super SomeSuperClass
    .method public createrInnerClass()V
         .limit stack 10
         .limit locals 10
         ;create a Inner object
         new Outer$Inner
         dup
         invokenonvirtual Outer$Inner/<init>(LOuter;)V
         ;test function must print a Outer class name
         invokevirtual Outer$Inner/testFunction ()V
    .end method
    ;This is inner class
    .source Outer$Inner.j
    .class Outer$Inner
    .super java/lang/Object
    .field final this$0 LOuter;
    ;contructor
    .method pubilc <init>(LOuter;)V
         .limit stack 10
         .limit locals 10
         aload_0
         invokenonvirtual Object/<init>()V
         aload_0
         aload_1
         putfield Inner$Outer/this$0 LOuter;
         return
    .end method
    ;test
    .method public testFunction ()V
         .limit stack 10
         .limit locals 10
         ;get out object
         getstatic java/io/PrintStream/out  java/io/PrintStream;
         aload_0
         invokevirtual java/lang/Object/getClass()java/lang/Class;
         ;now in stack Outer$Inner class
         invokevirtual java/Class/getDeclaringClass()java/lang/Class;
         ;but now in stack null
         invokevirtual java/io/PrintStream/print (Ljava/lang/Object;)V
    .end methodI used dejasmin. Code was equal.
    What I have to do? Why getDeclatingClass () returns null, but in dejasmin code
    it returns Outer class?

    Outer$Inner naming convention is not used by JVM to get declaring class.
    You need to have proper InnerClasses attribute (refer to http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#79996)
    in the generated classes. Did you check using jclasslib or another class file viewer and verified that your .class files have proper InnerClasses attribute?

  • Issue with JSPs with inner classes (bug)

    FYI:
    Turning on Versioning in the registry (Disable=0) JSPs with inner classes causes the following IllegalAccessException...
    This has been confirmed with SP3 and SP4 with our testing...
    14/Jan/2002 13:26:24:4] error: Exception: SERVLET-run_failed: Failed in running template: /NASApp/fortune/foo.jsp, java
    lang.IllegalAccessError: try to access class jsp.APPS.fortune.foo$foobar from class jsp.APPS.fortune.foo
    xception Stack Trace:
    ava.lang.IllegalAccessError: try to access class jsp.APPS.fortune.foo$foobar from class jsp.APPS.fortune.foo
    at jsp.APPS.fortune.foo._jspService(foo.java:78)
    at org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown Source)
    at com.netscape.server.servlet.servletrunner.ServletRunner.callJSP(Unknown Source)
    at com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse.callJspCompiler(Unknown Source)
    at com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse.callUri(Unknown Source)
    at com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse.callUriRestrictOutput(Unknown Source)
    at com.netscape.server.servlet.platformhttp.PlatformRequestDispatcher.forward(Unknown Source)
    at com.netscape.server.servlet.jsp.JSPRunner.service(Unknown Source)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown Source)
    at com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unknown Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.thread.ThreadBasic.run(Native Method)
    at java.lang.Thread.run(Thread.java:479)
    Looking for work around....
    Cheers,
    Martin Gee

    I do not see why you would use two sorts.
    And what is the issue exactly by the way? Errors?
    So, the records before the Merge Join need to come sorted, to achieve this simply tick:
    Arthur My Blog

  • Strange behaviour when using connection pooling with proxy authentication

    All
    I have developed an ASP.NET 1.1 Web application that uses ODP.NET 9.2.0.4 accessing Oracle Database 8i (which is to be upgraded to 10g in the coming months). I have enabled connection pooling and implemented proxy authentication.
    I am observing a strange behaviour in the live environment. If two users (User 1 and User 2) are executing SQL statements at the same time (concurrent threads in IIS), the following is occurring:
    * User 1 opens a new connection, executes a SELECT statement, and closes this connection. The audit log, which uses the USER function, shows User 1 executed this statement.
    * User 2 opens the same connection (before it is released to the connection pool?), excutes an INSERT statement, and closes this connection. The audit log shows User 1, not User 2, executed this statement.
    Is this a known issue when using connection pooling with proxy authentication? I appreciate your help.
    Regards,
    Chris

    Hi Chris,
    I tried to reproduce your complaint, but was unable to. I didnt use auditting however, just a series of "select user from dual" with proxy authentication. You might want to see if you can put together a small complete testcase for this and open a sr with support.
    Cheers
    Greg

  • Null pointer exception with inner class

    Hi everyone,
    I've written an applet that is an animation of a wheel turning. The animation is drawn on a customised JPanel which is an inner class called animateArea. The main class is called Rotary. It runs fine when I run it from JBuilder in the Applet Viewer. However when I try to open the html in internet explorer it gives me null pointer exceptions like the following:
    java.lang.NullPointerException      
    at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2761)      
    at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2722)      
    at Rotary$animateArea.paintComponent(Rotary.java:251)      
    at javax.swing.JComponent.paint(JComponent.java:808)      
    at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4771)      
    at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4724)      
    at javax.swing.JComponent._paintImmediately(JComponent.java:4668)      
    at javax.swing.JComponent.paintImmediately(JComponent.java:4477)      
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)      
    at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)      
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)      
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)      
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)      
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)      
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)      
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)      
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
    Do inner classes have to be compiled seperately or anything?
    Thanks a million for you time,
    CurtinR

    I think that I am using the Java plugin ( Its a computer in college so I'm not certain but I just tried running an applet from the Swing tutorial and it worked)
    Its an image of a rotating wheel and in each sector of the wheel is the name of a person - when you click on the sector it goes red and the email window should come up (that doesn't work yet though). The stop and play buttons stop or start the animation. It is started by default.
    This is the code for the applet:
    import java.applet.*;
    import javax.swing.JApplet;
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import java.awt.image.*;
    import java.util.StringTokenizer;
    import java.net.*;
    public class Rotary extends JApplet implements ActionListener, MouseListener
    public boolean rotating;
    private Timer timer;
    private int delay = 1000;
    private AffineTransform transform;
    private JTextArea txtTest; //temp
    private Container c;
    private animateArea wheelPanel;
    private JButton btPlay, btStop;
    private BoxLayout layout;
    private JPanel btPanel;
    public Image wheel;
    public int currentSector;
    public String members[];
    public int [][]coordsX, coordsY; //stores sector no. and x or y coordinates for that point
    final int TOTAL_SECTORS= 48;
    //creates polygon array - each polygon represents a sector on wheel
    public Polygon polySector1,polySector2,polySector3, polySector4, polySector5,polySector6,polySector7,polySector8,polySector9,polySector10,
    polySector11,polySector12,polySector13,polySector14,polySector15,polySector16,polySector17,polySector18,polySector19,polySector20,
    polySector21,polySector22,polySector23,polySector24,polySector25,polySector26,polySector27,polySector28,polySector29,polySector30,
    polySector31,polySector32,polySector33,polySector34,polySector35,polySector36,polySector37,polySector38,polySector39,polySector40,
    polySector41,polySector42,polySector43,polySector44,polySector45,polySector46,polySector47,polySector48;
    public Polygon polySectors[]={polySector1,polySector2,polySector3, polySector4, polySector5,polySector6,polySector7,polySector8,polySector9,polySector10,
                      polySector11,polySector12,polySector13,polySector14,polySector15,polySector16,polySector17,polySector18,polySector19,polySector20,
                      polySector21,polySector22,polySector23,polySector24,polySector25,polySector26,polySector27,polySector28,polySector29,polySector30,
                      polySector31,polySector32,polySector33,polySector34,polySector35,polySector36,polySector37,polySector38,polySector39,polySector40,
                      polySector41,polySector42,polySector43,polySector44,polySector45,polySector46,polySector47,polySector48};
    public void init()
    members = new String[TOTAL_SECTORS];
    coordsX= new int[TOTAL_SECTORS][4];
    coordsY= new int[TOTAL_SECTORS][4];
    currentSector = -1;
    rotating = true;
    transform = new AffineTransform();
    //***********************************Create GUI**************************
    wheelPanel = new animateArea(); //create a canvas where the animation will be displayed
    wheelPanel.setSize(600,580);
    wheelPanel.setBackground(Color.yellow);
    btPanel = new JPanel(); //create a panel for the buttons
    btPanel.setLayout(new BoxLayout(btPanel,BoxLayout.Y_AXIS));
    btPanel.setBackground(Color.blue);
    btPanel.setMaximumSize(new Dimension(30,580));
    btPanel.setMinimumSize(new Dimension(30,580));
    btPlay = new JButton("Play");
    btStop = new JButton("Stop");
    //txtTest = new JTextArea(5,5); //temp
    btPanel.add(btPlay);
    btPanel.add(btStop);
    // btPanel.add(txtTest); //temp
    c = getContentPane();
    layout = new BoxLayout(c,layout.X_AXIS);
    c.setLayout(layout);
    c.add(wheelPanel); //add panel and animate canvas to the applet
    c.add(btPanel);
    wheel = getImage(getDocumentBase(),"rotary2.gif");
    getParameters();
    for(int k = 0; k <TOTAL_SECTORS; k++)
    polySectors[k] = new Polygon();
    for(int n= 0; n<4; n++)
    polySectors[k].addPoint(coordsX[k][n],coordsY[k][n]);
    btPlay.addActionListener(this);
    btStop.addActionListener(this);
    wheelPanel.addMouseListener(this);
    startAnimation();
    public void mouseClicked(MouseEvent e)
    if (rotating == false) //user can only hightlight a sector when wheel is not rotating
    for(int h= 0; h<TOTAL_SECTORS; h++)
    if(polySectors[h].contains(e.getX(),e.getY()))
    currentSector = h;
    wheelPanel.repaint();
    email();
    public void mouseExited(MouseEvent e){}
    public void mouseEntered(MouseEvent e){}
    public void mouseReleased(MouseEvent e){}
    public void mousePressed(MouseEvent e){}
    public void email()
    try
    URL rotaryMail = new URL("mailto:[email protected]");
    getAppletContext().showDocument(rotaryMail);
    catch(MalformedURLException mue)
    System.out.println("bad url!");
    public void getParameters()
    StringTokenizer stSector;
    String parCoords;
    for(int i = 0; i <TOTAL_SECTORS; i++)
    {               //put member names in applet parameter list into an array
    members[i] = getParameter("member"+i);
    //separate coordinate string and store coordinates in 2 arrays
    parCoords=getParameter("sector"+i);
    stSector = new StringTokenizer(parCoords, ",");
    for(int j = 0; j<4; j++)
    coordsX[i][j] = Integer.parseInt(stSector.nextToken());
    coordsY[i][j] = Integer.parseInt(stSector.nextToken());
    public void actionPerformed(ActionEvent e)
    wheelPanel.repaint(); //repaint when timer event occurs
    if (e.getActionCommand()=="Stop")
    stopAnimation();
    else if(e.getActionCommand()=="Play")
    startAnimation();
    public void startAnimation()
    if(timer == null)
    timer = new Timer(delay,this);
    timer.start();
    else if(!timer.isRunning())
    timer.restart();
    Thanks so much for your help!

  • Problems importing a class with inner class

    Why can't I import a class so that I can use an (inner) static member class without naming the enclosing class. Put simply, I have:
    file C:\MyJava\Test\A:
    public class A {
      public static class B { }
    }file C:\MyJava\Test\C
    import A.*;
    public class C { }When I try to compile C (javac -classpath C:\MyJava\Test;. C.java) it fails with C.java:1: package A does not exist

    Class A must be in a package if you wish to import it. If you want to use the inner class, just import somepackage.A. You could then refer to A.B...
    HTH :o)

  • Error with inner Classes

    I've a Swing app in wich I've the following code :
    final ComboBoxEditor editor = comboBox.getEditor();
    editor.getEditorComponent().addKeyListener(new java.awt.event.KeyAdapter() {
    public void keyReleased(KeyEvent e) {
    combo_keyReleased(e,editor);
    Runned in a normal way it works, runned via Webstart 1.4.2 it gives me :
    java.lang.ClassFormatError: it/axioma/basic/application/templates/ClWidgetCombo$2 (Illegal Variable name " val$editor")
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         at com.sun.jnlp.JNLPClassLoader.defineClass(Unknown Source)
         at com.sun.jnlp.JNLPClassLoader.access$100(Unknown Source)
         at com.sun.jnlp.JNLPClassLoader$1.run(Unknown Source)
    etc...
    Could someone explain me why ?
    Is there any workaround ?
    TIA
    Tullio

    There seems to be a problem using final variables with anonymous inner classes under a different classloader, see http://forum.java.sun.com/thread.jsp?forum=38&thread=372291

  • Problems with inner classes

    I ran into the following problems when I tried to read into an inner class:
    This is my .jdo file
    <?xml version="1.0"?>
    <jdo>
    <package name="com.globalrefund.jdo.mna">
    <class name="Parameter$Syspar" objectid-class="SysparId">
    <extension vendor-name="kodo" key="table" value="syspar"/>
    <extension vendor-name="kodo" key="lock-column" value="none"/>
    <extension vendor-name="kodo" key="class-column" value="none"/>
    <field name="landescode" primary-key="true">
    <extension vendor-name="kodo" key="data-column"
    value="landescode"/>
    </field>
    <field name="waehrungscode">
    <extension vendor-name="kodo" key="data-column"
    value="waehrungscode"/>
    </field>
    </class>
    </package>
    </jdo>
    1.) appidtool does not work for this inner class, I get this stack trace
    C:\users\Bernhard\jbProject\refundManual>appidtool
    src\com\globalrefund\jdo\mna\Parameter$Syspar.jdo
    Generating an application id for type "class
    com.globalrefund.jdo.mna.Parameter$Syspar"...
    Exception in thread "main" java.lang.NullPointerException
    at com.solarmetric.kodo.enhance.ApplicationIdTool.getFile(Unknown
    Source)
    at
    com.solarmetric.kodo.enhance.ApplicationIdTool.writeApplicationId(Unknown
    Source)
    at
    com.solarmetric.kodo.enhance.ApplicationIdTool.writeApplicationId(Unknown
    Source)
    at com.solarmetric.kodo.enhance.ApplicationIdTool.main(Unknown
    Source)
    2.) I tried to use a hand coded inner class as ID class, but id did not work
    (is this not possible ?)
    Exception in thread "main" java.lang.NoSuchMethodError:
    com.globalrefund.jdo.mna.Parameter$SysparId: method <init>()V not found
    at
    com.globalrefund.jdo.mna.Parameter$Syspar.jdoNewObjectIdInstance(Parameter.j
    ava)
    at
    javax.jdo.spi.JDOImplHelper.newObjectIdInstance(JDOImplHelper.java:166)
    at com.solarmetric.kodo.util.ObjectIds.fromPKValues(Unknown Source)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.createFromResultSet(
    Unknown Source)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager$2.getResultObject(Un
    known Source)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.LazyResultList.instantiateRow(Unknown
    Source)
    at com.solarmetric.kodo.impl.jdbc.runtime.LazyResultList.get(Unknown
    Source)
    at java.util.AbstractList$Itr.next(AbstractList.java:416)
    at com.solarmetric.kodo.runtime.ResultListIterator.next(Unknown
    Source)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.ResultListFactory.createResultList(Un
    known Source)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(Unknown
    Source)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCQuery.executeQuery(Unknown
    Source)
    at com.solarmetric.kodo.query.QueryImpl.executeWithMap(Unknown
    Source)
    at com.solarmetric.kodo.query.QueryImpl.execute(Unknown Source)
    at
    com.solarmetric.kodo.query.QueryImpl$SynchronizedQuery.execute(Unknown
    Source)
    at com.globalrefund.jdo.mna.Parameter.<init>(Parameter.java:71)
    3.) It worked after I moved the ID class into a separate class
    Regards,
    Bernhard

    1.) appidtool does not work for this inner class, I get this stack traceThis is a bug. It will be corrected in the final release of 2.3, due out
    Real Soon Now. Thanks for catching this!
    2.) I tried to use a hand coded inner class as ID class, but id did not work
    (is this not possible ?)
    Exception in thread "main" java.lang.NoSuchMethodError:
    com.globalrefund.jdo.mna.Parameter$SysparId: method <init>()V not foundThis exception is saying that your application ID class does not have a
    no-args constructor. Make sure the id class is a static inner class;
    otherwise Java transparently adds a parent object parameter to each
    constructor, and so the application id class will violoate the JDO constraint
    of having a no-args constructor.

  • Please need help with Inner Classes

    Hi! I have the following inner class, but it is not an "explicit" inner class:
    import java.util.*;
    public class EXTERIOR_NOEXPLICITA {
         private Vector i;
         public void llena_Vector(int a){
              i = new Vector();
              for(int z=0;z<=a;z++)
                   i.addElement(""+z);
         public Enumeration test() {
              return new Enumeration(){
                   int item = i.size()-1;
                   public boolean hasMoreElements(){
                        return(item >= 0);
                   public Object nextElement(){
                        if(!hasMoreElements())
                             throw new NoSuchElementException();
                        else
                             return i.elementAt(item--);
    My question is, how can I put it in an explicyt inner class?
    Plese help me! =)
    Raul

    I am not entirely sure what you mean by explicit inner class. If you mean converting your anonymous class into a nested class, then it is quite easy:
    import java.util.*;
    public class EXTERIOR_NOEXPLICITA {
      private Vector i;
      public void llena_Vector(int a) {
        i = new Vector();
        for (int z = 0; z <= a; z++)
          i.addElement("" + z);
      private final class MyEnumeration implements Enumeration {
        int item = i.size() - 1;
        public boolean hasMoreElements() {
          return (item >= 0);
        public Object nextElement() {
          if (!hasMoreElements())
            throw new NoSuchElementException();
          else
            return i.elementAt(item--);
      public Enumeration test() {
        return new MyEnumeration();

  • Trouble with inner class

    jDeveloper 10.1.3.0.4
    i want to see the var Variable into a inner class
    public class myClass extends JFrame{
    int Variable;
    myClass(){
    fuction1();
    private fuction1(){
    jlogonOptionPane.addPropertyChangeListener(new PropertyChangeListener() {
    public void propertyChange(PropertyChangeEvent e) {
    // here, i wan to use Variable
    }// fuction1
    }// myclass
    why i cant see varible into propertyChange ?

    Hi,
    your code isn't complete and misses the jlogonOptionPane definition. If you use
    package adf.sample.view;
    import java.beans.PropertyChangeEvent;
    import java.beans.PropertyChangeListener;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    public class MyClass extends JFrame{
    private int mvariable = 2;
    MyClass(){
    function1();
    private void function1(){
    JOptionPane jlogonOptionPane = new JOptionPane();
    jlogonOptionPane.addPropertyChangeListener(new PropertyChangeListener() {
    public void propertyChange(PropertyChangeEvent e) {
    // here, i wan to use Variable
    }// fuction1
    }// myclass
    set the curser after
    // here, i wan to use Variable
    - hold the ctrl key and press the blank key
    - type mv and you will se mvariable
    Frank

  • Clearing weak references with inner classes

    I have a class which contains several inner classes. During it's lifetime, this object creates several instances of it's internal objects and uses them only internally.
    I also have a single weak reference that links to my object from anywhere external to the program.
    While profiling, I discovered a memory leak. After examining the core dump under jhat, it appears that the only objects linking to this object are that weak reference from the external program and several intantiated inner classes that reference my object via their implicit this$0 field.
    Is this possible? Does mixing inner classes and weak references stop the garbage collector from reclaiming classes?

    Based on the information you provide, I question your assertion that these inner objects are used only internally. The most obvious explanation is that you're leaking them and something else is holding a hard reference to them.

  • Strange behaviour that's not fixable with usual tricks

    Hi,
    i think i almost give up on the cs-suite, because i have a very annoying problem:
    i can't assign colors in a normal way (i.e. click on an object and assign one from the dropdown), i have to click on the palette
    a couple of times (and i have to do it quickly as well) otherwise its not working. And when i select an object it slightly changes its position.
    So i have to press crtl+z first and then i can modify it. Some operations like switching some tools, start the spinning beachball.
    Same happens in Illustrator and PS.
    One of the weirdest things is, that i have the exact same behaviour if I install it on our iMac or after a complete new reinstall on
    my own system (it just works a couple of times, then its there again).
    I run it on a MBP 2,4 GHz, 4GB Ram and 10.6.5. and CS 5 with all updates.
    I would be so happy if anyone could point my in the right direction.
    regards
    Chris

    Sometimes it's all about trial'n error!
    I used a little tool called "RightZoom" that helps to maximize the windows in osx the microsoft way. After killing the process, all worked flawlessly!
    So beware of this tool on production-machines!

  • Troubles with inner classes in swing-panel

    hi,
    I'm having troubles using innner classes as ActionListeners in my swing-panel. I keep getting compile-time errors:
    C:\Java programmer\DocGenerator\ListPanel.java:53: cannot resolve symbol
    symbol : class Actionlistener
    location: class ListPanel.RemoveListener
         class RemoveListener implements Actionlistener {
    ^
    C:\Java programmer\DocGenerator\ListPanel.java:33: addActionListener(java.awt.event.ActionListener) in javax.swing.AbstractButton cannot be applied to (ListPanel.RemoveListener)
              removeButton.addActionListener(new RemoveListener());
    ^
    2 errors
    Here is the source code:
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    class ListPanel extends JPanel implements ListSelectionListener{
         private JButton addButton = new JButton("add");     
         private JButton removeButton = new JButton("remove");
         private JButton resetButton = new JButton("reset");
         private JList list;
         private DefaultListModel listModel;
         public ListPanel(){
              listModel = new DefaultListModel();
              listModel.addElement("nummer1");
              listModel.addElement("nummer2");
              list = new JList(listModel);
              list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
              list.setSelectedIndex(0);
              list.addListSelectionListener(this);
              JScrollPane listScrollPane = new JScrollPane(list);
              setLayout(new GridLayout(1,2));
              JPanel buttons = new JPanel();
              buttons.setLayout(new GridLayout(3,1));
    //          addButton.addActionListener(this);
              removeButton.addActionListener(new RemoveListener());
    //          resetButton.addActionListener(this);
              buttons.add(addButton);
              buttons.add(removeButton);
              buttons.add(resetButton);
              list.setBorder(BorderFactory.createLineBorder(Color.black,3));
              add(buttons);
              add(list);
         public void actionPerformed(ActionEvent e){
              System.out.println(e);
         public void valueChanged(ListSelectionEvent e){
         class RemoveListener implements Actionlistener {
              public void actionPerformed(ActionEvent e){
                   int index = list.getSelectedIndex();
                   listModel.remove(index);
                   int size = listModel.getSize();
                   if(size==0){
                        addButton.setEnabled(false);
                   } else {
                        if (index==listModel.getSize())
                             index--;
                        list.setSelectedIndex(index);

    Both of the errors is because Actionlistener is not the same as ActionListener. Note the capital 'L' there!

  • One to many mapping - strange behaviour

    I noticed a strange behaviour which happens when working with 1 to n
    relationships. Maybe the behaviour is intended by the JDO specification or
    maybe I haven't set the proper kodo properties to make it work.
    Here's the problem:
    I have the following two classes wich I map to a database table each (using
    datastore identity):
    class Person
    private String name;
    private Collection cars;
    // setters and getters
    class Car
    private String model;
    private Person owner;
    // setters and getters
    When I have a persistent car object and I assign it to a persistent person
    like this:
    car.setOwner(person);
    and I immediately retrieve all cars of the person by calling:
    Collection c = person.getCars()
    the car ist not in the collection as I would expect it to be. In my opinion
    JDO should make sure the car is added to the collection.
    Even after I commit the whole transaction the car is still not in the
    collection.
    To make the car appear in the collection I have to create a new
    PersistentManager (when using javax.jdo.option.Optimistic=true) and refetch
    the person object again.
    Can anyone enlighten me on this problem?
    Thank you!
    Donat Hauser
    [email protected]
    mapping.jdo
    <class name="Person">
    <extension vendor-name="kodo" key="table" value="PERSON"/>
    <extension vendor-name="kodo" key="pk-column" value="ID"/>
    <extension vendor-name="kodo" key="lock-column" value="none"/>
    <extension vendor-name="kodo" key="class-column" value="none"/>
    <field name="name">
    <extension vendor-name="kodo" key="data-column"
    value="NAME"/>
    </field>
    <field name="cars">
    <collection element-type="Car"/>
    <extension vendor-name="kodo" key="inverse" value="owner"/>
    </field>
    </class>
    <class name="Car">
    <extension vendor-name="kodo" key="table" value="CAR"/>
    <extension vendor-name="kodo" key="pk-column" value="ID"/>
    <extension vendor-name="kodo" key="lock-column" value="none"/>
    <extension vendor-name="kodo" key="class-column" value="none"/>
    <field name="model">
    <extension vendor-name="kodo" key="data-column"
    value="MODEL"/>
    </field>
    <field name="owner">
    <extension vendor-name="kodo" key="data-column"
    value="OWNER"/>
    </field>
    </class>

    Donat,
    This is a bit of a philosophical question. One of the goals of JDO is to
    be as closely aligned to the Java language as possible, and Java has no
    concept of a shared relation. So, we do not perform any work to ensure
    that relations get 'magically' set on both sides. Instead, you must set
    both sides of the business relation yourself in Java code.
    The result of this is that code that you write will behave the same
    regardless of whether or not the objects are persistent. So, you can write
    test cases or non-persistent parts of your application and trust that the
    code will behave the same in both instances.
    -Fred
    In article <[email protected]>, M__ller Alfons wrote:
    >
    I noticed a strange behaviour which happens when working with 1 to n
    relationships. Maybe the behaviour is intended by the JDO specification or
    maybe I haven't set the proper kodo properties to make it work.
    Here's the problem:
    I have the following two classes wich I map to a database table each (using
    datastore identity):
    class Person
    private String name;
    private Collection cars;
    // setters and getters
    class Car
    private String model;
    private Person owner;
    // setters and getters
    When I have a persistent car object and I assign it to a persistent person
    like this:
    car.setOwner(person);
    and I immediately retrieve all cars of the person by calling:
    Collection c = person.getCars()
    the car ist not in the collection as I would expect it to be. In my opinion
    JDO should make sure the car is added to the collection.
    Even after I commit the whole transaction the car is still not in the
    collection.
    To make the car appear in the collection I have to create a new
    PersistentManager (when using javax.jdo.option.Optimistic=true) and refetch
    the person object again.
    Can anyone enlighten me on this problem?
    Thank you!
    Donat Hauser
    [email protected]
    mapping.jdo
    <class name="Person">
    <extension vendor-name="kodo" key="table" value="PERSON"/>
    <extension vendor-name="kodo" key="pk-column" value="ID"/>
    <extension vendor-name="kodo" key="lock-column" value="none"/>
    <extension vendor-name="kodo" key="class-column" value="none"/>
    <field name="name">
    <extension vendor-name="kodo" key="data-column"
    value="NAME"/>
    </field>
    <field name="cars">
    <collection element-type="Car"/>
    <extension vendor-name="kodo" key="inverse" value="owner"/>
    </field>
    </class>
    <class name="Car">
    <extension vendor-name="kodo" key="table" value="CAR"/>
    <extension vendor-name="kodo" key="pk-column" value="ID"/>
    <extension vendor-name="kodo" key="lock-column" value="none"/>
    <extension vendor-name="kodo" key="class-column" value="none"/>
    <field name="model">
    <extension vendor-name="kodo" key="data-column"
    value="MODEL"/>
    </field>
    <field name="owner">
    <extension vendor-name="kodo" key="data-column"
    value="OWNER"/>
    </field>
    </class>
    Fred Lucas
    SolarMetric Inc.
    202-595-2064 x1122
    http://www.solarmetric.com

  • Servicegen and inner classes

    I have a class that contains a public non-static inner class. Even though the inner class has a public default contructor, servicegen claims it can't find the constructor.
    Is this a servicegen bug or limitation with inner classes?

    Hi Ron,
    Sounds like a bug. Could you supply a short example?
    Thanks,
    Bruce
    Ron Mak wrote:
    I have a class that contains a public non-static inner class. Even though the inner class has a public default contructor, servicegen claims it can't find the constructor.
    Is this a servicegen bug or limitation with inner classes?

Maybe you are looking for

  • EDGE and HTML dynamic text in a "box" with scroll bar

    I'm new to EDGE, a win7pro master collection cs5.5 suite owner. I'm mainly in the Film/Video post production field (mostly AE, PPro, Pshop, IA) but have been branching into web design the last couple of years.  I use Dreamweaver, Fireworks, Flash. Wh

  • Can I Exchange My MW600 For A Different Colour?

    Hi, I bought my MW600 less than 3 weeks ago in Singapore. At the point of sale, I asked the salesperson if a WHITE version is available, and he said that NO it is not. I then bought the Black version as I was eager to try out a Sony Ericsson Bluetoot

  • How do I get a disc out of my super drive when I forgot to eject it from the drive before pulling out the USB cable ?

    how do I get a disc out of my super drive when I forgot to eject it from the drive before pulling out the USB cable ?

  • Authorization for navigational attribute

    Hi Gurus, I am facing an authorization issue with respect to infoobject hierarchy. I have created authorizations as below. There one infoobject 'A' and a navigational attribute 'B' in infoobject 'A'. This navigational atribure A_B is used in an infoc

  • HDMI to DVI

    Hi, I just ordered a recent MacMini with HDMI and Thunderbolt. I already own an older Apple Cinema Display (2005, I think 20'') with a DVI port. Will I be able to connect this display to the new mini via the HDMI to DVI adapter, or do I need to buy a