Iterator in swing

is it possible to use an iterator in the actionclass? im sure you are but for some reason i get the compile error:
SoftwareHouseFrame.java:567: cannot resolve symbol
symbol  : class Iterator
location: class SoftwareHouseFrame.ApplicationDisplayStaff
            Iterator iter = theSoftwareHouse.theStaff();
            ^
SoftwareHouseFrame.java:567: cannot resolve symbol
symbol  : method theStaff ()
location: class SoftwareHouse
            Iterator iter = theSoftwareHouse.theStaff();
                                            ^
2 errorsand no idea whats happening. I did import the java.util.* package
the code:
System.out.println("Display Staff");
//display the staff
SoftwareHouseFrame.this.theViewingArea.append("\n" + theSoftwareHouse);
SoftwareHouseFrame.this.theViewingArea.append("\n\t" + "Staff in the " + theSoftwareHouse);
boolean stafffound = false;
Iterator iter = theSoftwareHouse.getStaffIterator();
while(iter.hasNext() == true)
Programmer employee = (Programmer)iter.next();
//check size of iterator/container
SoftwareHouseFrame.this.theViewingArea.append("\n\t\t" + employee);
stafffound = true;
if(stafffound == false)
SoftwareHouseFrame.this.theViewingArea.append("\n\tNo Staff");

ok found the problem but still get this one:
SoftwareHouseFrame.java
SoftwareHouseFrame.java:567: cannot resolve symbol
symbol  : method theStaff ()
location: class SoftwareHouse
            Iterator iter = theSoftwareHouse.theStaff();
                                            ^
1 error

Similar Messages

  • Bind iterator to Swing panel (upgrade issue)

    Hi
    How do I create an iterator binding for a Swing JUPanel using JDev 10.1.3?
    In 10.1.2 I could easily create one by right clicking the UIModel.xml and selecting Create Binding->Data->Iterator. In 10.1.3 I don't have this option on the pagedef.xml file. What is the equivalent operation?
    I've spent the past 1/2 hr reading Help files and searching posts but can't find this info.
    thanks
    John

    oh, i just found the "insert inside executables" option in the structure window. ok, that works

  • ADF/Swing: changing iterator in runtime before displaying panel

    Is it possible ,before displaying panel, to change iterator name that was specified in design time and is placed in panel.pageDef xml file and this way display panel with different iterator than is in panel.pageDef file? If yes, is it posible display this way many panels in the same time?

    Hi,
    the iterator is referenced by the attribute binding. If you look at the Swing code then you see that the Swing widgets reference a named attribute binding in their model binding. To change the iterator you would need to access the ADF binding layer and change it there. which I haven't tried.
    The attribute binding references an iterator as a named reference, which means that changing the physical implementation - in theory - works if the same set of attributes are available.
    Frank

  • Iteration, multithread access, cuncurrenthashmap, swing, Strange Error

    Hi,
    Lets start with the error:
    Exception in thread "Thread-2" java.lang.IllegalStateException
         at java.util.concurrent.ConcurrentHashMap$HashIterator.remove(Unknown Source)
         at DrawFrame$allthread.run(DrawFrame.java:569)
         at java.lang.Thread.run(Unknown Source)Next lets look at the code:
                        Iterator<Rectangle> hr = rectangles.values().iterator();
                                       while (hr.hasNext()) {
                                            Rectangle rh = hr.next();
                                                                         if (somecondition){
                                                                             hr.remove();
                                                            }So apparently it looks like I'm trying to remove a rectangle, this works fine for a while, but then will randomly break at an unexpected time. Anyone got any advice? I think the error should be apparent. By the way, this is hashmap is getting used by seperate threads... but it is a cuncurrenthashmap.
    Whats goin on?
    Nate

    Myth shot down in flames...
    package forums;
    import java.util.Iterator;
    import java.util.Map;
    import java.util.HashMap;
    import java.util.concurrent.ConcurrentMap;
    import java.util.concurrent.ConcurrentHashMap;
    class ConcurrentHashMapPutAllContainingNullTest
      public static void main(String[] args) {
        try {
          Map<Integer,String> map = new HashMap<Integer,String>();
          map.put(1, "ONE");
          map.put(2, null);
          map.put(3, "THREE");
          ConcurrentMap<Integer,String> cache = new ConcurrentHashMap<Integer,String>();
          cache.putAll(map); // this is line 19
        } catch (Exception e) {
          e.printStackTrace();
    produces
    C:\Java\home\src\forums>"C:\Program Files\Java\jdk1.6.0_07\bin\java.exe" -Xms512m -Xmx1024m -enableassertions -cp C:\Java\home\classes; forums.ConcurrentHashMapPutAllContainingNullTest
    java.lang.NullPointerException
            at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:881)
            at java.util.concurrent.ConcurrentHashMap.putAll(ConcurrentHashMap.java:909)
            at forums.ConcurrentHashMapPutAllContainingNullTest.main(ConcurrentHashMapPutAllContainingNullTest.java:19)

  • Using Swing as interface to a dll

    I am trying to use Swing as my cross platform GUI for c++ dll's. Each dll has its own GUI. However, one of my dll's controls what other dlls are loaded. This works fine until I try to load a second instance of the control dll. I get an access violation message when I try to update my gui. If I try to load the two dlls from the c++ everything works fine, but if I load one from the Java GUI I get an null access exception. I'm guessing its caused by one of two problems:
    1) The DLL loading is trashing the executing stack of either the JAVA or the native code.
    2) As the code returns from the constructor call to the newly loaded dll JNI is deleting the interface objects that it is creating on the heap.
    Any ideas would be greatly appreciated.
    Unfortunately I don't get an error log from JAVA.
    VisualStudio gives me:
    Unhandled exception at 0x10014a7d (nativedll.dll) in testjava.exe: 0xC0000005: Access violation reading location 0xfeeefef6.
    The print out reads:
    Creating Java VM
    No. Created VMs 0
    Creating Frame
    Created frame
    Begin master update loop
    Calling Update
    Updated Frame 0
    Creating Java VM
    No. Created VMs 1
    Creating Frame
    Created frame
    Calling Update
    I am using Visual Studio .Net 2003 and jdk 1.4.4, 1.5.0_08 and 1.6.0.
    Main application:
    #include "Windows.h"
    #include "nativelibrary.h"
    #include <stdlib.h>
    #include <string.h>
    #include "jni.h"
    int main(int argc, char* argv[])
           //Load first library
         HMODULE handle = LoadLibrary( "../../nativedll/debug/nativedll.dll");
         nativelibrary* (*funcPtr)();
         funcPtr = (nativelibrary*(*)())GetProcAddress( handle, "createObj");
         nativelibrary* newObj = (*funcPtr)();
            // update each library
         for (int i = 0; i < 10000; i++)
              printf ("Begin master update loop\n");
              void (*funcPtr2)();
              funcPtr2 = (void(*)())GetProcAddress( handle, "update");
              (*funcPtr2)();
              printf ("End master update loop\n");
              Sleep(10);
         // Sleep(100000);
         return 0;
    }Main Library
    #include <iostream>
    #include "jni.h"
    #include "MyFrame.h"
    #include "StaticFunc.h"
    #include <stdlib.h>
    #include <vector>
    #include "Windows.h"
    using namespace std;
    class nativelibrary
    public:
         JavaVM *jvm;
         JNIEnv *env;
         jclass cls;
         jobject myFrame;
         nativelibrary();
         void locupdate();
         static vector<nativelibrary*> objects;
    vector<nativelibrary*> nativelibrary::objects;
    nativelibrary* createObj()
         return new nativelibrary();
    nativelibrary::nativelibrary()
         // JavaVMOption options[0];
         JavaVMInitArgs vm_args;
         memset(&vm_args, 0, sizeof(vm_args));
         vm_args.version = JNI_VERSION_1_4;
         vm_args.nOptions = 0;
         vm_args.ignoreUnrecognized = true;
         vm_args.nOptions = 0;
         // vm_args.options = options;
         JavaVM** jvmBuf = (JavaVM**)malloc(sizeof(JavaVM*));
         jsize buflen = 1;
         jsize nVMs =0;
         // vm_args.options[0].optionString = "-Djava.class.path=../../bin/Debug";
         // Create the Java VM
         printf("Creating Java VM\n");
         jint res = JNI_GetCreatedJavaVMs(jvmBuf, buflen, &nVMs);
         if ( res >= 0)
              printf("No. Created VMs %i\n", nVMs);
              if ( nVMs > 0)
                   jvm = jvmBuf[0];
                   res = jvm->GetEnv((void**)&env,vm_args.version);
              else
                   res = JNI_CreateJavaVM(&jvm,(void**)&env,&vm_args);
         else
              res = JNI_CreateJavaVM(&jvm,(void**)&env,&vm_args);
         cls = env->FindClass("LMyFrame;");     
         if ( cls == 0 ) printf("Cannot find MyFrame");
         jmethodID mid = env->GetMethodID(cls, "<init>", "()V");
         if ( mid == 0 ) printf("Cannot find constructor");
         printf("Creating Frame\n");
         myFrame = env->NewObject(cls, mid);
         if (env->ExceptionOccurred())
              env->ExceptionDescribe();
         printf("Created frame\n");
         objects.push_back(this);
    void nativelibrary::locupdate()
         printf("Calling Update\n");
         jmethodID updatemid = env->GetMethodID(cls, "update", "()V");
         if ( updatemid == 0 ) printf("Cannot find update");
         env->CallVoidMethod(myFrame, updatemid);
         if (env->ExceptionOccurred())
              env->ExceptionDescribe();
    void update()
         vector<nativelibrary*>::iterator it = nativelibrary::objects.begin();
         while (it != nativelibrary::objects.end())
              nativelibrary* lib = *it;
              lib->locupdate();
              it++;
    JNIEXPORT void JNICALL Java_MyFrame__1createObj
      (JNIEnv *, jclass)
         createObj();
    }Java Class (User interface)
    class MyFrame
         static native void _createObj();
         static int creations = 0;
         int framenum;
         MyFrame()
              System.loadLibrary("../../nativedll/Debug/nativedll");
              framenum = creations++;
         void update()
              System.out.println("Updated Frame " + framenum);
              if ( creations == 1)
                   // load dll as a result of the user clicking on the interface
                   createObj();
         public static void createObj()
              _createObj();
    }

    I am trying to use Swing as my cross platform GUI for c++ dll's. Each dll has its own GUI. However, one of my dll's controls what other dlls are loaded. This works fine until I try to load a second instance of the control dll. I get an access violation message when I try to update my gui. If I try to load the two dlls from the c++ everything works fine, but if I load one from the Java GUI I get an null access exception. I'm guessing its caused by one of two problems:
    1) The DLL loading is trashing the executing stack of either the JAVA or the native code.
    2) As the code returns from the constructor call to the newly loaded dll JNI is deleting the interface objects that it is creating on the heap.
    Any ideas would be greatly appreciated.
    Unfortunately I don't get an error log from JAVA.
    VisualStudio gives me:
    Unhandled exception at 0x10014a7d (nativedll.dll) in testjava.exe: 0xC0000005: Access violation reading location 0xfeeefef6.
    The print out reads:
    Creating Java VM
    No. Created VMs 0
    Creating Frame
    Created frame
    Begin master update loop
    Calling Update
    Updated Frame 0
    Creating Java VM
    No. Created VMs 1
    Creating Frame
    Created frame
    Calling Update
    I am using Visual Studio .Net 2003 and jdk 1.4.4, 1.5.0_08 and 1.6.0.
    Main application:
    #include "Windows.h"
    #include "nativelibrary.h"
    #include <stdlib.h>
    #include <string.h>
    #include "jni.h"
    int main(int argc, char* argv[])
           //Load first library
         HMODULE handle = LoadLibrary( "../../nativedll/debug/nativedll.dll");
         nativelibrary* (*funcPtr)();
         funcPtr = (nativelibrary*(*)())GetProcAddress( handle, "createObj");
         nativelibrary* newObj = (*funcPtr)();
            // update each library
         for (int i = 0; i < 10000; i++)
              printf ("Begin master update loop\n");
              void (*funcPtr2)();
              funcPtr2 = (void(*)())GetProcAddress( handle, "update");
              (*funcPtr2)();
              printf ("End master update loop\n");
              Sleep(10);
         // Sleep(100000);
         return 0;
    }Main Library
    #include <iostream>
    #include "jni.h"
    #include "MyFrame.h"
    #include "StaticFunc.h"
    #include <stdlib.h>
    #include <vector>
    #include "Windows.h"
    using namespace std;
    class nativelibrary
    public:
         JavaVM *jvm;
         JNIEnv *env;
         jclass cls;
         jobject myFrame;
         nativelibrary();
         void locupdate();
         static vector<nativelibrary*> objects;
    vector<nativelibrary*> nativelibrary::objects;
    nativelibrary* createObj()
         return new nativelibrary();
    nativelibrary::nativelibrary()
         // JavaVMOption options[0];
         JavaVMInitArgs vm_args;
         memset(&vm_args, 0, sizeof(vm_args));
         vm_args.version = JNI_VERSION_1_4;
         vm_args.nOptions = 0;
         vm_args.ignoreUnrecognized = true;
         vm_args.nOptions = 0;
         // vm_args.options = options;
         JavaVM** jvmBuf = (JavaVM**)malloc(sizeof(JavaVM*));
         jsize buflen = 1;
         jsize nVMs =0;
         // vm_args.options[0].optionString = "-Djava.class.path=../../bin/Debug";
         // Create the Java VM
         printf("Creating Java VM\n");
         jint res = JNI_GetCreatedJavaVMs(jvmBuf, buflen, &nVMs);
         if ( res >= 0)
              printf("No. Created VMs %i\n", nVMs);
              if ( nVMs > 0)
                   jvm = jvmBuf[0];
                   res = jvm->GetEnv((void**)&env,vm_args.version);
              else
                   res = JNI_CreateJavaVM(&jvm,(void**)&env,&vm_args);
         else
              res = JNI_CreateJavaVM(&jvm,(void**)&env,&vm_args);
         cls = env->FindClass("LMyFrame;");     
         if ( cls == 0 ) printf("Cannot find MyFrame");
         jmethodID mid = env->GetMethodID(cls, "<init>", "()V");
         if ( mid == 0 ) printf("Cannot find constructor");
         printf("Creating Frame\n");
         myFrame = env->NewObject(cls, mid);
         if (env->ExceptionOccurred())
              env->ExceptionDescribe();
         printf("Created frame\n");
         objects.push_back(this);
    void nativelibrary::locupdate()
         printf("Calling Update\n");
         jmethodID updatemid = env->GetMethodID(cls, "update", "()V");
         if ( updatemid == 0 ) printf("Cannot find update");
         env->CallVoidMethod(myFrame, updatemid);
         if (env->ExceptionOccurred())
              env->ExceptionDescribe();
    void update()
         vector<nativelibrary*>::iterator it = nativelibrary::objects.begin();
         while (it != nativelibrary::objects.end())
              nativelibrary* lib = *it;
              lib->locupdate();
              it++;
    JNIEXPORT void JNICALL Java_MyFrame__1createObj
      (JNIEnv *, jclass)
         createObj();
    }Java Class (User interface)
    class MyFrame
         static native void _createObj();
         static int creations = 0;
         int framenum;
         MyFrame()
              System.loadLibrary("../../nativedll/Debug/nativedll");
              framenum = creations++;
         void update()
              System.out.println("Updated Frame " + framenum);
              if ( creations == 1)
                   // load dll as a result of the user clicking on the interface
                   createObj();
         public static void createObj()
              _createObj();
    }

  • Error calling WSDL Service in Swing application.

    I'm having the following error when calling a web service in a Swing Application.
    getUserInfo is defined and properly deployed. I tried several time to recreate WSDL cache and auto generated code, but nothing changed.
    Exception occurred during event dispatching:
    java.lang.Error: java.lang.reflect.InvocationTargetException
    Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.jdesktop.application.ApplicationAction.noProxyActionPerformed(ApplicationAction.java:662)
        ... 88 more
    Caused by: java.lang.Error: Undefined operation name getUserInfos
        at com.sun.xml.ws.model.JavaMethodImpl.freeze(JavaMethodImpl.java:327)
        at com.sun.xml.ws.model.AbstractSEIModelImpl.freeze(AbstractSEIModelImpl.java:97)
        at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:268)
        at com.sun.xml.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:683)
        at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:340)
        at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:323)
        at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:305)
        at javax.xml.ws.Service.getPort(Unknown Source)
        at com.up4b.mercury.services.ServerManagerService.getServerManagerPort(ServerManagerService.java:56)
        at com.up4b.mercury.client.MercuryClientLoginBox.checkUser(MercuryClientLoginBox.java:139)
        ... 93 more

    OK.
    So here is an inside view of what I'm doing:
    Service is coded in a J2EE Web Application like this:
         * Web service operation
        @WebMethod(operationName = "userInfos")
        public Musers userInfos(@WebParam(name = "userId")
        Long userId) {
            return serverManager.getUserInfos(userId);
        }And in the client (Swing application generated by Netbeans) the code is:
    try { // Call Web Service Operation
                        com.up4b.mercury.services.CampaignManagerService service = new com.up4b.mercury.services.CampaignManagerService();
                        com.up4b.mercury.services.CampaignManager port = service.getCampaignManagerPort();
                        java.lang.Integer campaignId = client.getCampaignId();
                        java.util.List<com.up4b.mercury.services.Mstatus> result = port.getStatusList(campaignId);
                        Iterator iter = result.iterator();
                        String[] statusArray = new String[255];
                        statusArray[0] = "Sélectionner un statut";
                        int i = 1;
                        while (iter.hasNext()) {
                            com.up4b.mercury.services.Mstatus ts = (com.up4b.mercury.services.Mstatus) iter.next();
                            statusArray[i] = ts.getStatusSdesc();
                            i++;
                        status.setToolTipText("Statut de la fiche");
                        status.setModel(new javax.swing.DefaultComboBoxModel(statusArray));
                        status.setSelectedIndex(0);
                        // Reset pause mode to false and button to proper state
                        pauseButton.setSelected(false);
                        pauseButton.setText("Pause");
                        pauseState = false;
                    } catch (Exception ex) {
                        getClient().setIsActive(false);
                    }

  • [Swing ADF] add a new row based on existing one

    Hi all,
    I start with ADF and here is my problem:
    In a swing ADF application, I'd like to allow user to create new records based on a record already present in the DB. The user selects a record in the data table and then push a button that fill in some JTextField. He can then change whatever he wants. These JTextField are in fact arguments of a method of my Application Module. Then, when a button "add", that is created by drag and drop the method, is pushed, the method of the AM is called.
    The problem is: argument are null. This occure when I fill in the gap (JTextField) programmatically (by getting the currentRow of the iterator of the table). But if the user fill in the gap himself, then arguments are not null.
    Is there someone to help me?
    Thanks a lot!
    Regards

    Hi,
    I created the method, dragged the arguments as textFields and added the method call as a button.
    I then dragged and dropped teh Departments ViewObject as a table and created a button with the following action code
    private void jButton2_actionPerformed(ActionEvent e) {
    DCIteratorBinding dciter = (DCIteratorBinding) panelBinding.get("DepartmentsView1Iterator");
    Number deptId = (Number) dciter.getCurrentRow().getAttribute("DepartmentId");
    String dname = (String) dciter.getCurrentRow().getAttribute("DepartmentName");
    Number locId = (Number) dciter.getCurrentRow().getAttribute("LocationId");
    ((JUTextFieldBinding) panelBinding.get("deptId")).setInputValue(deptId);
    ((JUTextFieldBinding) panelBinding.get("dname")).setInputValue(dname);
    ((JUTextFieldBinding) panelBinding.get("locationId")).setInputValue(locId);
    panelBinding.refresh();
    Pressing the button copies the values to the input arguments and pressing the method button sends the values to the method
    Frank

  • Avoid iterating through everything

    Hello all,
    Hope you guys can help me with this problem. I have a program that draws anywhere from 1-300,000 letters on a canvas. Each letter is created from a class called StringState which extends Rectangle. What I would like to do is have each letter respond when the user moves the mouse over the letter by growing bigger. I figured I can just see if the letters bounds contains the point where the mouse moved to and if it does change the letters size and repaint around that letter to update the display. This works great from 1-5000 letters but getting up to 10,000 or even higher creates a very visible lag while the program is iterating through the letters to check if the mouse location intersects the letters bounds. What I was wondering is there a way to get this result without iterating through the entire collection of letters to see if it contains the mouse location? Like can I attach some kind of mouse listener to each letter or something like that? The following program just demonstrates how I create and display the letters I haven't really had a chance to create a demonstration of how they would grow when hovered over. The program i'm working on that actually demonstrates this is very large and hard to trim down to show an example so the following code is actually from a previous question I asked and was provided by Aephyr. Thanks in advance for your guys help :)
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    import java.util.List;
    public class PaintSurface implements Runnable, ActionListener {
         public static void main(String[] args) {
              SwingUtilities.invokeLater(new PaintSurface());
         Tableaux tableaux;
         Random random = new Random();
    //        Point mouselocation = new Point(0,0);
         static final int WIDTH = 1000;
         static final int HEIGHT = 1000;
            JFrame frame = new JFrame();
         public void run() {
              tableaux = new Tableaux();
              for (int i=15000; --i>=0;)
                   addRandom();
              frame.add(tableaux, BorderLayout.CENTER);
              JButton add = new JButton("Add");
              add.addActionListener(this);
              frame.add(add, BorderLayout.SOUTH);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setSize(WIDTH, HEIGHT);
              frame.setLocationRelativeTo(null);
    //                frame.addMouseMotionListener(new MouseListener());
              frame.setVisible(true);
         public void actionPerformed(ActionEvent e) {
              addRandom();
         void addRandom() {
              tableaux.add(
                        Character.toString((char)('a'+random.nextInt(26))),
                        UIManager.getFont("Button.font"),
                        random.nextInt(WIDTH), random.nextInt(HEIGHT));
    //        class MouseListener extends MouseAdapter {
    //            public void mouseMoved(MouseEvent e) {
    //                mouselocation = new Point(e.getX(),e.getY());
    //                frame.repaint();
            class StringState extends Rectangle {
                    StringState(String str, Font font, int x, int y, int w, int h) {
                            super(x, y, w, h);
                            string = str;
                            this.font = font;
                    String string;
                    Font font;
            class Tableaux extends JComponent {
                 Tableaux() {
                      this.enableEvents(MouseEvent.MOUSE_MOTION_EVENT_MASK);
                      lagState = createState("Lag", new Font("Arial",Font.BOLD,20), 0, 0);
                 protected void processMouseMotionEvent(MouseEvent e) {
                      repaint(lagState);
                      lagState.setLocation(e.getX(), e.getY());
                      repaint(lagState);
                      super.processMouseMotionEvent(e);
                 StringState lagState;
                    List<StringState> states = new ArrayList<StringState>();
                    StringState createState(String str, Font font, int x, int y) {
                        FontMetrics metrics = getFontMetrics(font);
                        int w = metrics.stringWidth(str);
                        int h = metrics.getHeight();
                        return new StringState(str, font, x, y-metrics.getAscent(), w, h);
                    public void add(String str, Font font, int x, int y) {
                         StringState state = createState(str, font, x, y);
                            states.add(state);
                            repaint(state);
                    protected void paintComponent(Graphics g) {
                            Rectangle clip = g.getClipBounds();
                            FontMetrics metrics = g.getFontMetrics();
                            for (StringState state : states) {
                                    if (state.intersects(clip)) {
                                            if (!state.font.equals(g.getFont())) {
                                                    g.setFont(state.font);
                                                    metrics = g.getFontMetrics();
                                            g.drawString(state.string, state.x, state.y+metrics.getAscent());
                            if (lagState.intersects(clip)) {
                            g.setColor(Color.red);
                            if (!lagState.font.equals(g.getFont())) {
                                g.setFont(lagState.font);
                                metrics = g.getFontMetrics();
                            g.drawString("Lag", lagState.x, lagState.y+metrics.getAscent());
    }Here is the code that iterates through the letters to see if a letter contains the mouse location:
                if(e.getSource()==canvas&&edit) {
                    for(Letter l : letters) {
                        Rectangle rec = new Rectangle(l.x+l.xoffset,l.y+l.yoffset,l.width,l.height);
                        if(rec.contains(new Point(e.getX(),e.getY()))&&l.resizing==false&&l.defaultSize==l.font.getSize()) {
                            l.resizing = true;
                            new Thread(new ExpandLetter(l)).start();
                        else if(!rec.contains(new Point(e.getX(),e.getY()))&&l.resizing==false){
                            l.font = new Font(l.font.getName(),l.font.getStyle(),l.defaultSize);
                            l.resizeLetter(l.text);
                }However I just learned that this loop itself is taking up a huge amount of memory by saying
    l.font = new Font(l.font.getName(),l.font.getStyle(),l.defaultSize); When I take that line out the lag is reduced by a lot. Also I think that it isn't forgetting the "old" letters font that it is replacing by saying new Font() and after running this loop once my program runs slow and laggy as if it doesn't have enough memory to run fast anymore. Is there something I am doing wrong by initiating a new Font. I would have thought that it wouldn't take up anymore memory because it replaces the old font the the letter "l" has. The loop seems to have some kind of memory leak if someone could point it out to me that would be great. Thanks :)
    Edited by: neptune692 on Feb 16, 2010 8:18 PM

    neptune692 wrote:
    can I attach some kind of mouse listener to each letterTry this:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.font.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import java.util.*;
    import javax.swing.event.*;
    public class SimplePaintSurface implements Runnable, ActionListener {
        private static final int WIDTH = 1250;
        private static final int HEIGHT = 800;
        private Random random = new Random();
        private JFrame frame = new JFrame("SimplePaintSurface");
        private JPanel tableaux;
        public void run() {
            tableaux = new JPanel(null);
            for (int i = 15000; --i >= 0;) {
                addRandom();
            frame.add(tableaux, BorderLayout.CENTER);
            JButton add = new JButton("Add");
            add.addActionListener(this);
            frame.add(add, BorderLayout.SOUTH);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setSize(WIDTH, HEIGHT);
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
            tableaux.requestFocusInWindow();
        public void actionPerformed(final ActionEvent e) {
            addRandom();
            tableaux.repaint();
        void addRandom() {
            Letter letter = new Letter(Character.toString((char) ('a' + random.nextInt(26))));
            letter.setBounds(random.nextInt(WIDTH), random.nextInt(HEIGHT), 16, 16);
            tableaux.add(letter);
        public static void main(final String[] args) {
            SwingUtilities.invokeLater(new SimplePaintSurface());
    class Letter extends JLabel {
        Font font1;
        Font font2;
        private final FontRenderContext fontRenderContext1;
        private final FontRenderContext fontRenderContext2;
        public Letter(final String letter) {
            super(letter);
            setFocusable(true);
            setBackground(Color.RED);
            font1 = getFont();
            font2 = font1.deriveFont(48f);
            fontRenderContext1 = getFontMetrics(font1).getFontRenderContext();
            fontRenderContext2 = getFontMetrics(font2).getFontRenderContext();
            MouseInputAdapter mouseHandler = new MouseInputAdapter() {
                @Override
                public void mouseEntered(final MouseEvent e) {
                    Letter.this.setOpaque(true);
                    setFont(font2);
                    Rectangle bounds = getBounds();
                    Rectangle2D stringBounds = font2.getStringBounds(getText(), fontRenderContext2);
                    bounds.width = (int) stringBounds.getWidth();
                    bounds.height = (int) stringBounds.getHeight();
                    setBounds(bounds);
                @Override
                public void mouseExited(final MouseEvent e) {
                    Letter.this.setOpaque(false);
                    setFont(font1);
                    Rectangle bounds = getBounds();
                    Rectangle2D stringBounds = font1.getStringBounds(getText(), fontRenderContext1);
                    bounds.width = (int) stringBounds.getWidth();
                    bounds.height = (int) stringBounds.getHeight();
                    setBounds(bounds);
            addMouseListener(mouseHandler);
    }

  • Dealing with Swing Layouts

    I have a collection of small panels with fixed size (around 50x50), and a main panel with size around 600x480.
    At run time I need to show this collection of panels on my main panel.
    Based on your experience, what would be the best layout to show them on my main panel?
    I have tried setting up a GridLayout on my main panel, but my small panels always got resized to fill my main panel, no matter how I tried to stablish the number of rows (length % rows == 0? 0 : 1 + len depending on my collection size.
    Also tried with a flowlayout, but when I added a JSCrollPanel, instead of adding new rows, my scrollpanel kept adding them on the same line :( I even enforced my scroller to
    Is this the correct behaviour? Am I doing something wrong? (I'm sure I do :))
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.FlowLayout;
    import java.awt.GridLayout;
    import java.util.List;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import static javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER;
    public class JClass extends JFrame{
        private JPanel panel;
        private JScrollPane scroll;
        protected JClass() {
            panel = new JPanel();
            scroll = new JScrollPane(panel);
            scroll.setHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_NEVER);
            JPanel menu  = new JPanel();
            JButton but  = new JButton("show");
            but.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                   display(5);
            BorderLayout layout = new BorderLayout();
            FlowLayout layout2 = new FlowLayout();
            layout2.setAlignment(FlowLayout.LEFT);
            panel.setLayout(layout2);
            menu.add(but);
            this.setPreferredSize(new Dimension(640,480));
            this.setLayout(layout);
            this.add(scroll, BorderLayout.CENTER);
            this.add(menu,BorderLayout.WEST);
            pack();       
        public void display(int n){
            JButton button;      
            for(int i = 0; i < n; i++){
                button = new JButton();
                button.setPreferredSize(new Dimension(30,30));
                this.panel.add(button);
            this.validate();
            this.repaint();     
        public static void main(String args[]) {
            JClass app = new JClass();
            app.setDefaultCloseOperation(EXIT_ON_CLOSE);
            app.setVisible(true);
    }

    Thanks Camickr.
    And just for the sake of it, do you think is there a way to do it with GridLayout? I mean, fixing the number of columns to three, but without resizing the small panels I will be adding. Maybe by fixing the preferredSize of the panel with the gridlayout to the small panels width * 3 + something?
    In my previous iteration I tried it but this content panel would always take my maximum space, thus expanding my small panels... :(

  • I18n of Swing for multilingual feature of a already displayed screen

    I have java Swing appication.Each screen has got number of buttons, labels, tool bar etc.It also have DateFormat, SimpleDateFormat, and DateFormatSymbols used for the i18n.Each screen has got a combobox listing diffrent languages.From each screen the user can select a language and that particular screen should change to this selected language.ie, suppose I have displayed the screen in English and if the user select a language french, then this particular screen should change to French.Can you please give me a way to solve this problem? My requirement are I have to iterate through each component of this container and set the labels for each component by getting the key(But I don't know how to get the key dynamically?).Then my next problem is I have used SimpleDateFormat by passing the Locale to its instantiate method.So if I am changing the language from the combobox should I have to recreate all the components in this screen? If anybody ever met this kind of requirement can you please give a sugestion or code snippet?If I know the language before showing the screen then it is OK. But converting a displayed screen to other languages....

    Hi,
    my solution is to create any GUI on JPanels and only switch between them by some central Switcher (The Frame in my example). Any GUI only must be implemented one time and you do not need any loop to change texts.
    Switching Interface:
    import java.util.Locale;
    public interface Switcher {
         public void doSwitch(Locale l);
    }Main class:
    import java.util.Locale;
    import javax.swing.JFrame;;
    public class SwitchingFrame extends JFrame implements Switcher{
         public SwitchingFrame(){
              super("Switchit");
              add(new SwitchingPanel(this));
         public void doSwitch(Locale l) {
              Locale.setDefault(l);
              getContentPane().removeAll();
              getContentPane().add(new SwitchingPanel(this));
              getContentPane().validate();
         public static void main(String args[]){
              SwitchingFrame f = new SwitchingFrame();
              f.setVisible(true);
    }GUI Panel:
    import java.awt.FlowLayout;
    import java.awt.event.ActionListener;
    import java.awt.event.ItemEvent;
    import java.awt.event.ItemListener;
    import java.util.Locale;
    import java.util.ResourceBundle;
    import javax.swing.JButton;
    import javax.swing.JComboBox;
    import javax.swing.JPanel;
    public class SwitchingPanel extends JPanel {
         private Switcher switcher;
         public SwitchingPanel(Switcher s){
              switcher = s;
              setLayout(new FlowLayout());
              ResourceBundle b = ResourceBundle.getBundle("i18n.Texts");
              JButton b1 = new JButton(b.getString("Button1"));
              JButton b2 = new JButton(b.getString("Button2"));
              JComboBox bx = new JComboBox(new String[]{"de", "en"});
              bx.setSelectedItem(b.getString("Selection"));
              add(bx);
              bx.addItemListener(new ItemListener(){
                   public void itemStateChanged(ItemEvent e) {
                        if(e.getStateChange() == ItemEvent.SELECTED){
                             switcher.doSwitch(new Locale((String)e.getItem()));
              add(b1);
              add(b2);
    }And two Bundles for Testing:
    import java.util.Enumeration;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.ResourceBundle;
    public class Texts extends ResourceBundle {
         private HashMap<String, String> map = new HashMap<String, String>();
         public Texts(){
              map.put("Button1", "Switch");
              map.put("Button2", "Cancel");
              map.put("Selection", "en");
         @Override
         protected Object handleGetObject(String key) {
              return map.get(key);
         @Override
         public Enumeration<String> getKeys() {
              return new Enumeration <String>(){
                   Iterator <String>it = map.keySet().iterator();
                   public boolean hasMoreElements() {
                        return it.hasNext();
                   public String nextElement() {
                        return it.next();
    import java.util.Enumeration;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.ResourceBundle;
    public class Texts_de extends ResourceBundle {
         private HashMap<String, String> map = new HashMap<String, String>();
         public Texts_de(){
              map.put("Button1", "Wechseln");
              map.put("Button2", "Abbrechen");
              map.put("Selection", "de");
         @Override
         protected Object handleGetObject(String key) {
              return map.get(key);
         @Override
         public Enumeration<String> getKeys() {
              return new Enumeration <String>(){
                   Iterator <String>it = map.keySet().iterator();
                   public boolean hasMoreElements() {
                        return it.hasNext();
                   public String nextElement() {
                        return it.next();
    }hope this helps,
    Lars.

  • ADF Swing LOV problem

    Hi,
    I created an application using ADF Swing with JDeveloper version 10.1.3.2.0.4066.
    I made a form contains JTable and Edit Form which using some LOVs to insert or update data. Something weird happen when user insert data using LOV.
    Scenario:
    1. firstly, JTable contains some data, let say 5 records.
    2. User want to input some new data (the sixth record), then user push (+) button in JUNavigationBar, then one new record is added into JTable
    3. User want to edit the new record, then user push Edit button which will display Edit Form
    4. User push button which will display LOV to insert the correct record, after selecting a record from LOV then user push OK button from LOV form, then LOV form will be closed.
    5. User performing commit to permanently save data to database.
    now, the weird part:
    6. User want to input the second record, then user push (+) button in JUNavigationBar, then one new record (the seventh record) is added into JTable
    7. User want to edit the new record, then user push Edit button which will display Edit Form
    8. User push button which will display LOV to insert the correct record, after selecting a record from LOV then user push OK button from LOV form, hoping that LOV form will close but NOT. User need to push OK button twice to make the LOV Form closed.
    so that is the weird thing, if user input the third record (the eighth record), then user need to push OK button three times to make the LOV Form being closed, if user input 100 record then user need to push OK button 100 times to close LOV Form. Weird?
    but if user close the main form first, then display the form again and input the new record using LOV (the seventh record), the weird thing is not gonna happen.
    how I can solve this weird thing?
    thanks

    below is step by step creation of ADF Form and how the error happened and handled (using Oracle JDeveloper 10.1.3.3.0.4157) :
    1. create database connection using JDeveloper wizard.
    a. supply connection name: dbscott
    b. supply username: scott, password: tiger, deploy password is checked.
    c. Driver: thin, hostname, JDBC Port, and SID as installed
    d. test connection: sucess
    2. from JDeveloper, open Application Navigator and then create new application:
    a. application name: ScottApp
    b. application path: default
    c. application package prefix: test.scott
    d. application template: [Swing, ADF BC]
    e. OK button pushed
    3. now, configuring Oracle Business Component:
    a. from Model project, right click and select New
    b. select ADF business component from business tier and select Business Components from tables on the right pane
    c. click OK
    d. select dbscott on the connection option. SQL Flavor and Type MAp: default
    e. click OK
    f. with only object type table is selected, shuttle all table object into selected pane and specify package to test.scott.model.entities
    g. click next
    h. shuttle all object into selected pane and specify package to test.scott.model.queries
    i. click next twice
    j. specify application module: ScottModule
    k. click next and then finish
    4. now, creating ADF Form object
    a. on the View Project, right click and select New
    b. select ADF Swing on the client tier and empty form on the right pane
    c. click OK
    d. supply form name: EmpForm, generate menu bar and generate login dialog option is unselected
    e. click next and then finish
    f. then JDeveloper will display its excellent Swing Editor, select JUNavigationBar on the EmpForm and then delete
    g. click form EmpForm and on data Panel specify layout to FormLayout
    h. on the FormLayout popo up menu, specify rows to 8 and columns to 3, insert gap is selected, click OK of course.
    i. on the data control palette, drag and drop EmpView1 to the first rows and column, then on the Add Child menu select Navigation Bar
    j. select NavigationBar, on the blue point, drag to the third column. right click NavigationBar, select Column Properties menu and click grow. then OK
    k. on the component palette, select Swing Container, drag and drop JScrollPane to the second row and first column
    l. with JScrollPane selected, on the blue point drag JScrollPane so its covers second to seventh row and first to third column
    m. right click on JScrollPane, select Row Properties menu and select Grow. click OK then
    n. on the Data Controls palette, drag and drop EmpView1 to JScrollPane, on the Add Child menu select table.
    5. now, creating ADF Edit Form object:
    a. rigth click on the View Object, select New
    b. select ADF Swing on the client tier and select Empty Panel on the right pane.
    c. Panel name: EditEmpForm, other option default
    d. click next and finish
    e. then JDeveloper will display EditEmpForm editor
    f. on the Data Controls palette, drag and drop EmpView1 to EditEmpForm then select Add Edit Form
    g. then Select Contrl window will be displayed. Click new to add LOV for Deptno
    h. new attribute will be added on the bottom, change attribute to Deptno and its control to Button LOV. create label option for this attribute is unselected.
    i. click OK
    j. adjust width and height the new panel created by JDeveloper properly
    k. in the Application Navigator, double click PanelEmpView1Helper, supply text for Deptno LOV JButton.
    6. configuring Deptno LOV JButton:
    a. with LOV JButton is selected, select model in its property inspector, then model window will be displayed
    b. LOV Update Attribute Tab is active, in Lov (source) Data Collection Pane, select DeptView1 and click New buttion below to create new iterator, click OK to create new iterator for DeptView1.
    c. click add button to add LOV attributes
    d. select deptno in the LOV Attributes and select Deptno in the target attributes.
    c. select LOV Display Attributes, shuttle all attributes to the right pane.
    d. click OK to finish configuring LOV
    7. adding EditEmpForm to EmpForm:
    a. with Empform is active in the editor, from Application Navigator drag and drop EditEmpForm.java to the last row on the first column of EmpForm.
    b. Select Option window will be displayed, select Display Panel in JDialog and Invoke JDialog from Button option is selected
    c. then a JButton will be added to last row on the first colum of EmpForm. Adjust this button to be displayed properly
    Then the creation of ADF Form is complete. We're able to create this powerful form with NO CUSTOM PROGRAMMING AT ALL, it's all because of Oracle ADF. But wait... we will run this scenario to perform how the error happen.
    Assumption, a user want to perform edit and insert data on EmpForm. He will perform following task:
    a. Run EmpForm, then the form will be displayed at runtime.
    b. The user want to edit data first, so he select a row then click Edit button, then EditEmpForm will be displayed.
    c. user edit one or more data, displaying LOV to edit Deptno. at this time, he just need to push OK button at LOV Form once. After completing edit, user close EditEmpForm by clicking OK button, EditEmpForm will be closed.
    d. now, user want to insert new record, simply at EmpForm user click (+) button at navigation bar to create new record, user click Edit button to display EditEmpForm, the user filling new information and of course diplaying LOV to select Deptno, now user need to click OK button in LOV form TWICE to be able to close the LOV Form. The user then click OK button to close EditEmpForm and back to EmpForm.
    e. The user think that just intermittent error, now he want to update data again. So, he do perfectly the same step before but now he need to click OK button from LOV Form THREE TIMES to close LOV Form. The user then click OK button to close EditEmpForm and back to EmpForm.
    f. after thinking hardly why this happened to him, the user then performing commit transaction then close EmpForm and open again.
    g. now user perform update data again but this time he just need to click OK button from LOV form once.
    The above error will not happened if the user open EditEmpForm just once ! if he close and open again EditEmpForm then he need to click and click OK button from LOV Form as many as he open EditEmpForm.
    I don't know why this happen, if something not right from how I create the application which causing this error, please let me know.
    regards,
    wong jowo

  • How to bind value from one form to another form in ADF Swings

    I am very new to ADF Swings need an Help ! . I have generated two forms one in FILTER FORM and another one is DETAILS FORM. Two parameter are defined in Filter Form 1. Name and 2 .Id and values are entered in textbox and combo box .Based on selected record or entered value in FILTER FORM i have to display that matching or filtered records in DETAIL FORM .I working this in ADF Swings . At present i am retrieving and displaying the records from a single table .
    Regards
    Prakash

    Hi frank,
    Thanks for the reply . I was trying in other way by the following code . But here i am getting class cast exception in line number five. Can you provide a few step to sort out the issue.
    private EatonSalesOrderDemo eatonSalesOrderDemo=new EatonSalesOrderDemo(); [Object Created For Details Screen]
    eatonSalesOrderDemo.setBindingContainer(createDetailBinding()); [ With the reference setting Binding Container]
    DCIteratorBinding iterBinding = getPanelBinding().findIteratorBinding("...."); [get master current row, get detail accessor iterator, then bind detail form iterator binding to  detail accessor iterator ]
    Row row = iterBinding.getCurrentRow();
    RowSetIterator detailAccessor = (RowSetIterator)row.getAttribute("....");
    eatonSalesOrderDemo.getPanelBinding().findIteratorBinding("....").bindRowSetIterator(detailAccessor, false);
    eatonSalesOrderDemo.setVisible(true);
    int count = 0;
    private DCBindingContainer createDetailBinding()
    String detailBCName = "EatonSalesOrderDemoPageDef"+count;
    if (panelBinding.getBindingContext().get(detailBCName) == null)
    DCBindingContainerDef bcdef = DCBindingContainerDef.findDefObject("oracle.eaton.view.pageDefs.EatonSalesOrderDemoPageDef");
    DCBindingContainer bc = bcdef.createBindingContainer(panelBinding.getBindingContext());
    bc.setName(detailBCName);
    panelBinding.getBindingContext().put(detailBCName, bc);
    ++count; //make sure the next name is unused thus far.
    return bc;
    return null;
    Regards
    Bhanu Prakash

  • Need Help With Iteration Problem

    So I recently decided I would try and make a program to help me edit my mp3 ID3 tags. I'm relatively new to Java but can usualy figure things out on my own. My code is rarely efficient but it gets the job done. So here's the deal. I got this package from ID3.org and started messing around with it. I can get it to edit the tags but not with an iteration. Here's my code:
    import javax.swing.*;
    import de.vdheide.mp3.*;
    import java.io.*;
    class ID3TagEdit {
         public static void main(String args[]) {
              String dir = chooseDir();
              String[] fileList = makeList(dir);
              String filename = "";
              for(int i = 0; fileList[i] != "null"; i++) {
                   try {
                        filename = dir + "\\" + fileList;
                        MP3File currentFile = new MP3File(filename);
                        TagContent tc = currentFile.getArtist();
                        tc.setContent("TEST");
                        currentFile.setArtist(tc);
                        currentFile.update();
                   catch(IOException e) {
                        System.out.println("Error 101");
                   catch(FrameDamagedException e) {
                        System.out.println("Error 102");
                   catch(NoMP3FrameException e) {
                        System.out.println("Error 103");
                   catch(TagFormatException e) {
                        System.out.println("Error 104");
                   catch(ID3Exception e) {
                        System.out.println("Error 105");
                   catch(ID3v2WrongCRCException e) {
                        System.out.println("Error 106");
                   catch(ID3v2Exception e) {
                        System.out.println("Error 107");
         public static String chooseDir() {
              String FolderPath = "";
              try {
                   JFileChooser chooser = new JFileChooser();
                   chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
                   int returnVal = chooser.showOpenDialog(null);
                   FolderPath = chooser.getSelectedFile().getPath();
              catch(IllegalArgumentException e) {
                   System.out.println("Error 201");
              return FolderPath;
         public static String[] makeList(String dir) {
              File directory = new File(dir);
              String[] fileList = directory.list();
              return fileList;
    If I don't iterate it then it will work. If I omit the 'for' loop and change the code to this:
                        filename = dir + "\\" + fileList[3];
                        MP3File currentFile = new MP3File(filename);
                        TagContent tc = currentFile.getArtist();
                        tc.setContent("TEST");
                        currentFile.setArtist(tc);
                        currentFile.update();
    It works just fine. Any suggestions on what I'm doing wrong?

    If I don't iterate it then it will work. If I omit
    the 'for' loop and change the code to this:
    It works just fine. Any suggestions on what I'm
    doing wrong?You said
    without loop it works just fine.Then what's the wrong?
    If you don't use loop then your fileList may not be null.And then your program'll be in infinite loop.

  • Swing button to insert row in displayed table records set

    Hi,
    I have been trying to insert custom row by pressing button in Swing form, this row should be displayed as last record in the records set fetched from table shown in the Swing form, can I have a help on this.
    cheers.

    Hi,
    the way you do this with ADF is to create an action binding for the ViewObject's CreateInsert operation. You do this in the pageDef file. Then from teh button, you use the panelBinding object to execute that method. Get access to the iterator binding and fill in the infromation you want to add. Then commit the change.
    If i find time I'll blog an example at orablogs.oracle.com/fnimphius
    Frank

  • ADF Swing Empty form probmlem

    Hello,
    I'm trying to follow the "Build a Java Swing Application with Oracle ADF"Cue Cards. I'm stocked at the step 5 (create a Master Form in ADF Swing Form).
    When I try to add a collection OrdersView1 to empty form I've got error messages:
    D:\JDeveloper\tutorial\OrdersApplicationADF\View\src\view\PanelOrdersView1Helper.java
    Error(99,30): identifier $objects not found
    Error(105,30): identifier $objects not found
    Error(111,30): identifier $objects not found
    Error(117,30): identifier $objects not found
    In the xml there is following code:
    if ("Hide".equalsIgnoreCase(panelBinding.getDisplayHint("OrdersView1",
    "OrderDate",
    null))) {
    dataPanel.remove(mOrderDate);
    dataPanel.remove($objects.LabelVariableName);
    if ("Hide".equalsIgnoreCase(panelBinding.getDisplayHint("OrdersView1",
    "OrderId",
    null))) {
    dataPanel.remove(mOrderId);
    dataPanel.remove($objects.LabelVariableName);
    if ("Hide".equalsIgnoreCase(panelBinding.getDisplayHint("OrdersView1",
    "OrderStatusCode",
    null))) {
    dataPanel.remove(mOrderStatusCode);
    dataPanel.remove($objects.LabelVariableName);
    if ("Hide".equalsIgnoreCase(panelBinding.getDisplayHint("OrdersView1",
    "OrderTotal",
    null))) {
    dataPanel.remove(mOrderTotal);
    dataPanel.remove($objects.LabelVariableName);
    Can you help me? What I did wrong?

    Hi,
    Timo's approach works if you use e.g. ADF BC and then drag the "Create" operation as a method activity to the task flow diagram before you navigate to the view. As Timo mentions, if you want to abandon the row you can't just press cancel but i) navigate to another method activity you create from the "Delete" operation, or ii) access the current row in the iterator to remove it there before navigating off.
    Another approach is to expose a method on the ADF BC client interface that creates a new row in ADF BC. You can then drag and drop the method as a parameter form, which initially would be empty
    Frank

Maybe you are looking for

  • How to store forms fields into the session ?

    Hi All, I have to store forms fields into the session. I have four forms (htm forms) in four jsps and there are total 25 fields. I am inserting all the fields into the database at once while user submit the last form. I want to use session to store f

  • Tunneling result not OK,

    Hi, What can you tell me about the following exception that I get trying to call a bean on Weblogic 6.1. My program tries to take the connection for several minutes and then java console shows the exception below. The problem doesn't occur when I tak

  • AAA and Certificate Based VPN

    We have a pair of 5520 firewalls with a traditional setup of AAA vpn authenication on the backend. We are looking to do some proof of concepts with a certificate based VPN and the Anyconnect client on startup. To set this up, I have my existing VPN p

  • The apple care protection plan

    my ipod's lcd screen is broke and i need it repaired to use the ipod, and i was wondering if i could buy this and then send my ipod in for repairs, also does that plan cover something like this? i have only have only had my ipod for abotu 2 or 3 mont

  • Won't boot from Tech Tool disk

    According to the Tech Tool disc that came with AppleCare for my Macbook Pro, holding 'c' is how you boot from the disk. It does not, the machine boots right into to main disk. I need to run disc utilities to see why my drive seems to be chattering so