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();
}

Similar Messages

  • What is the best way to use Swing GUIs in an MVC design?

    I have a question on how to build an application using swing frames for the UI, but using an MVC architecture. I've checked the rest of the forum, but not found an answer to my question that meets my needs.
    My application at this stage presents a login screen to get the userid and password, or to allow the user to choose a new locale. If an Enter action is performed, the userid and password are checked against the DB. If not accepted, the screen is repainted with a "try-again" message. If the Cancel action is performed, the process stops. If a locale action is performed, the screen is repainted with different langauge labels. Once the login process is passed, a front screen (another swing frame) is presented.
    Implementation: I am using a session object (Session, represents the user logging in) that calls the Login screen (LoginGUI, a Swing JFrame object with various components). Session uses setters in LoginGUI to set the labels, initial field entries etc, before enabling the screen. From this point, the user will do something with the LoginGUI screen - could be closing the window, entering a mix of userid and password, or maybe specifying a locale. Once the user has taken the action, if required, the session object can use getters to retrieve the userid and password values entered in the fields.
    The crux of the problem is 1) how will Session know that an action has been taken on the LoginGUI, and 2) how to tell what action has been taken.
    This could be solved by getting LoginGUI to call back to Session, however, I am trying to buid the application with a good separation of business, logic and presentation (i.e MVC, but not using any specific model). Therefore, I do not want LoginGUI to contain any program flow logic - that should all be contained in Session.
    I am aware of two possible ways to do this:
    1. Make LoginGUI synchronised, so that Session waits for LoginGUI to send a NotifyAll(). LoginGUI could hold a variable indicating what has happened which Session could interrogate.
    2. Implement Window Listener on Session so that it gets informed of the Window Close action. For the other two actions I could use a PropertyChangeListener in Session, that is notified when some variable in LoginGUI is changed. This variable could contain the action performed.
    Has anyone got any comments on the merits of these methods, or perhaps a better method? This technique seems fundamental to any application that interfaces with end-users, so I would like to find the best way.
    Thanks in advance.

    Hi,
    I tried to avoid putting in specific code as my question was more on design, and I wanted to save people having to trawl through specific code. And if I had any school assignments outstanding they would be about 20 years too late :-). I'm not sure computers more sophisticated than an abacus were around then...
    Rather than putting the actual code (which is long and refers to other objects not relevant to the discussion), I have put together two demo classes to illustrate my query. Comments in the code indicate where I have left out non-relevant code.
    Sessiondemo has the main class. When run, it creates an instance of LoginGUIdemo, containing a userid field, password field, a ComboBox (which would normally have a list of available locales), an Enter and a Cancel box.
    When the Locale combo box is clicked, the LoginGUIdemo.userAction button is changed (using an ActionListener) and a property change is fired to Session (which could then perform some work). The same technique is used to detect Enter events (pressing return in password and userid, or clicking on Enter), and to detect Cancel events (clicking on the cancel button). Instead of putting in business code I have just put in System.out.printlns to print the userAction value.
    With this structure, LoginGUIdemo has no business logic, but just alerts Sessiondemo (the class with the business logic).
    Do you know any more elegant way to achieve this function? In my original post, I mentioned that I have also achieved this using thread synchronisation (Sessiondemo waits on LoginGUI to issue a NotifyAll() before it can retrieve the LoginGUI values). I can put together demo code if you would like. Can you post any other demo code to demonstrate a better technique?
    Cheers,
    Alan
    Here's Sessiondemo.class
    import java.io.*;
    import java.awt.event.*;
    import java.util.*;
    import java.beans.*;
    public class Sessiondemo implements PropertyChangeListener {
        private LoginGUIdemo lgui;   // Login screen
        private int localeIndex; // index referring to an array of available Locales
        public Sessiondemo () {
            lgui = new LoginGUIdemo();
            lgui.addPropertyChangeListener(this);
            lgui.show();
        public static void main(String[] args) {
            Sessiondemo sess = new Sessiondemo();
        public void propertyChange(java.beans.PropertyChangeEvent pce) {
            // Get the userAction value from LoginGUI
            String userAction = pce.getNewValue().toString();
            if (userAction == "Cancelled") {
                System.out.println(userAction);
                // close the screen down
                lgui.dispose();
                System.exit(0);
            } else if (userAction == "LocaleChange") {
                System.out.println(userAction);
                // Get the new locale setting from the LoginGUI
                // ...modify LoginGUI labels with new labels from ResourceBundle
    lgui.show();
    } else if (userAction == "Submitted") {
    System.out.println(userAction);
    // ...Get the userid and password values from LoginGUIdemo
                // run some business logic to decide whether to show the login screen again
                // or accept the login and present the application frontscreen
    }And here's LoginGUIdemo.class
    * LoginGUIdemox.java
    * Created on 29 November 2002, 18:59
    * @author  administrator
    import java.beans.*;
    public class LoginGUIdemo extends javax.swing.JFrame {
        private String userAction;
        private PropertyChangeSupport pcs;
        /** Creates new form LoginGUIdemox */
        // Note that in the full code there are setters and getters to allow access to the
        // components in the screen. For clarity they are not included here
        public LoginGUIdemo() {
            pcs = new PropertyChangeSupport(this);
            userAction = "";
            initComponents();
        public void setUserAction(String s) {
            userAction = s;
            pcs.firePropertyChange("userAction",null,userAction);
        public void addPropertyChangeListener(PropertyChangeListener l) {
            pcs.addPropertyChangeListener(l);
        public void removePropertyChangeListener(PropertyChangeListener l) {
            pcs.removePropertyChangeListener(l);
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        private void initComponents() {
            jTextField1 = new javax.swing.JTextField();
            jTextField2 = new javax.swing.JTextField();
            jComboBox1 = new javax.swing.JComboBox();
            jButton1 = new javax.swing.JButton();
            jButton2 = new javax.swing.JButton();
            getContentPane().setLayout(new java.awt.FlowLayout());
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            jTextField1.setText("userid");
            jTextField1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    EnterActionPerformed(evt);
            getContentPane().add(jTextField1);
            jTextField2.setText("password");
            jTextField2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    EnterActionPerformed(evt);
            getContentPane().add(jTextField2);
            jComboBox1.setToolTipText("Select Locale");
            jComboBox1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    LocaleActionPerformed(evt);
            getContentPane().add(jComboBox1);
            jButton1.setText("Enter");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    EnterActionPerformed(evt);
            getContentPane().add(jButton1);
            jButton2.setText("Cancel");
            jButton2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    CancelActionPerformed(evt);
            getContentPane().add(jButton2);
            pack();
        private void LocaleActionPerformed(java.awt.event.ActionEvent evt) {
            setUserAction("LocaleChange");
        private void CancelActionPerformed(java.awt.event.ActionEvent evt) {
            setUserAction("Cancelled");
        private void EnterActionPerformed(java.awt.event.ActionEvent evt) {
            setUserAction("Submitted");
        /** Exit the Application */
        private void exitForm(java.awt.event.WindowEvent evt) {
            System.exit(0);
         * @param args the command line arguments
        public static void main(String args[]) {
            new LoginGUIdemo().show();
        // Variables declaration - do not modify
        private javax.swing.JTextField jTextField2;
        private javax.swing.JTextField jTextField1;
        private javax.swing.JComboBox jComboBox1;
        private javax.swing.JButton jButton2;
        private javax.swing.JButton jButton1;
        // End of variables declaration

  • How to pull data from EJB and present them using Swing ?

    Hi all,
    I've written stateful session bean which connect to Oracle database, and now I must write stand alone client application using Swing.
    The client app must present the data and then let users add,delete and edit data and it must be flexible enough to iterate through the records.
    The swing components can be JTextField,JTable etc.
    How to pull the data from EJB and present them to users with the most efficient network trip ?
    Thanks in advance
    Setya

    Thanks,
    Since the whole app originally was client-server app and I want to make it more scalable, so I decide to separate business logic in the EJB but I also want to keep the performance and the userfriendliness of the original user interface, and I want to continue using Swing as the original user interface does.
    I've read about using Rowset and I need some opinions about this from you guys who already have some experience with it.
    Any suggestions would be greatly appreciated.
    Thanks
    Setya

  • Why  do we use Swing?

    Hello all,
    The Java Specification tell us that AWT is different with Swing, The AWT component is heavy-weight while Swing is light-weight, and the light-weight component can be painted only when they are added into a heavy-weight window.
    Can anyone tell me why??
    Thx

    Problem 1: more classes and object methods than you can shake a stick at. Too damn many
    Yes, it's quite true that there are a lot of classes and methods. How else would you expect to get the wide range of functionality that Swing provides? In any case, you don't have to use or even know about most of them, only a small subset related to what you're doing. For example, to create a simple dialog box you need only know about JFrame and the components you'll be putting in it (JButton, etc.).
    Problem 2: some inconsistencies in the methods that apply to one object do not logically apply to another similar eg: TextArea, TextPane, JEditorPane, DefaultStyledDocument.
    Could you give specific examples?
    Problem 3: swing was designed to look sleek, individual (with a 'I am java' stamp) and stylish too. This most certainly failed, to most its just flat, grey and boring. (Yeah, yeah, I know - the swing set that comes in the samples with 1.4 looks orgasmic)
    Swing was designed to use a pluggable look & feel; you can set its appearance to one of several preinstalled sets or download one that suits your needs. For me, anyway, I don't want my applications to look "individual"; I want consistency in my user interface. I may prefer the Mac look & feel to Windows', but I would never want a Windows application to attempt to follow the Mac user interface conventions; having to switch frequently between fundamentally different user interface styles would drastically reduce my efficiency.
    Problem 4: performance! Its just too damn slow.
    Yes, Swing is slow compared to native user interface toolkits, but that's the price you pay for full cross-platform compatibility. I for one would never want to go back to the days of "write once, debug everywhere" that were the result of using native user interface components, which as a matter of course have many subtle (and some not-so-subtle) differences across different platforms.
    I believe Swing is a great user interface toolkit, and that it's headed in the right direction. It does have many rough edges, but for its age it is quite robust. The reason we use Swing, in my opinion, is that it provides the best combination of simplicity and functionality in a free, cross-platform user interface toolkit.
    Mike

  • Controling a user interface with extern DLL

    Hi,
    I am currently developing an application that is based on a graphical interface. I divide my code into multiple DLLs. By going this route, I met several problems. I want to know some facts:
    1 - from the DLL can I  assign values ​​to textbox,  read listbox of the GUI:GetCtrlVal (panelHandle, PANEL_TEXTBOX, val); (the GUI is integrating in the project who call the DLL)
    2 - I use global variables "extern int" in my files. h and my functions. How do I change this variable declaration when I migrate to the DLL.
    If you have any exemple describing how can i control a GUI with extern DLL.
    Thanks

    Hey Fishingman,
    It looks like this post is very similar to your other post on Application Architecture.  If this is the case, let's continue this discussion on this thread so that it is easier to follow for anyone else who may be keeping up with this. 
    To expand on my original response a little though - if you are just looking to be able to modify the user interface in a dll then take a look at this link.  It explains how to set up dll function calls to modify a user interface.  Again, I wouldn't suggest building your entire GUI through different dlls but it is definitely possible to modify it within a dll.
    Regards,
    Trey C.

  • Getting one window to progress to another using swing

    Ive got to design a simple quizgame interface using Swing. Its got to have a player's front-end - gives a selection of questions where the user selects one of five answers, a scoring front-end - displayed after game that allows user to enter their name and a manager's front-end - used to enter questions. The thing is I only have to design the interface. I want to have a front window that leads to the managers front end, scoreboard, and game seperatley. I also want the system to report back when the players got the question wrong or right and then take them to a scoreboard. I dont know how to keep this all seperate from the normal code in the program being written by someone else. I also dont know how to make one window lead to another etc. Please can someone help. does anyone have some code I coulkd adapt for this purpose Im really stuck!!!

    How are you using sounds in your movie? Exported to frame 1
    from the library (linkage)?
    see this:
    http://www.kennybellew.com/tutorial/
    --> **Adobe Certified Expert**
    --> www.mudbubble.com
    --> www.keyframer.com
    dcrawford wrote:
    > I've searched on this topic with several keywords to no
    avail.
    >
    > I have a sound playing (1.wav). I would like that sound
    to stop playing and
    > another (2.wav) to start when a button is pressed. How
    do I do this?
    >
    > So far I can either I can have both sounds playing, or
    neither (stopallsounds)
    > when it's clicked; but I would like to stop 1.wav and
    start 2.wav and can't
    > figure it out. Help!
    >

  • How to create a form which uses graphical user interfaces(GUI) features.

    i'm working as a administrator in a private college..i have some problem..
    how to create a student registration form that uses most of the graphical user interfaces(GUI) features. The form should consist of the following features:- Label, Button, Check box, Radio Button, List, Panel and Layout. The GUI features must be functional.
    how to write that programme in JAVA ?
    please help me to get the code..

    So are you saying that this person is legitamately asking for someone to write up this student registration form, for use in some sort of production student registration application? Ok, if so, I apologize for jumping to the wrong conclusion. But, to me it sounds like a student hit the "Using Swing" chapter in the text and was given the following assignment:
    For this assignment you are working as an administrator in a private college and you need to solve the following problem:
    You need to create a student registration form that uses most of the graphical user interfaces(GUI) features. The form should consist of the following features:- Label, Button, Check box, Radio Button, List, Panel and Layout. The GUI features must be functional.
    You have two weeks.
    Now, I suppose that I could be wrong, if so, I apologize and go with the previous poster that said ask a comp sci student to do this for you.
    Lee

  • Read a excel file using swings

    Does anyone know about reading an excel file using swings?
    Right now, I am using com.f1j.ss.*. But looking for more examples like reading and writing a excel file.
    Please suggest me with some good examples?

    1- Swing allows you to design a graphical user interface (to display data from a db or excel file for example)
    2- [Here |http://www.rgagnon.com/javadetails/java-0516.html] several ways to read/write excel.

  • Errors when Math Interface Toolkit creates dll

    Dear NI experts.
    When I want to use Labview Math Interface Toolkit  to create a simplest DLL, I got errors(see attachment), I can not get the dll file.
    My vi is just like y=x+1.
    My operating system is : WinXP sp2
    Labview : Professional Development System, Labview 8
    Math Interface Toolkit : don't know the version, just download from NI on 30 June 2006.
    Looking forward of reply soon.
    Many thanks
    Attachments:
    mit errors.jpg ‏20 KB

    Hi Z
    Please make sure that you have version 1.0.2 of the math interface tool kit as version 1 is not fully compatible with LabVIEW 8 you can check what version you have if you got to start>>control panel>> Add Remove programs >>National Instruments>>change look for Math Interface Toolkit XX.
    Here is a link to check what version of the tool kit you need for different versions of LabVIEW
    http://www.ni.com/support/labview/lvtool.htm#math
    I have added a link witch deals with some of errors that might occur while using math scrip it also has some useful additional links at the bottom of the page
    Error When Calling a MEX File Created With the Math Interface Toolkithttp://digital.ni.com/public.nsf/websearch/55708A4​952BDD4A386256E85005720B4
    I hope this helps
    Tim
    Applications Engineer | National Instruments | UK & Ireland

  • Integrate a graphical interface in a dll

    Hello
    I developed an application that uses a graphical interface as input interface
    the program executable mode works properly,
    I created the project dll and I tried to use the language (MTL)
    I managed to read the function and executed (by proving popup msg) but the problem I can not launch the GUI "graphical interface" , I think we should integrate. "uir" but I have not found means
    you find attached the error msg when called, who can help me please
    Attachments:
    error in call.JPG ‏134 KB

    You are probably running into the probelem described into this KnowledgeBase entry.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Can't use Swing in my java application

    I installed J2SE 5 Update 4 on my machine and was trying my hands on creating GUI using swing. I kept getting the error message: "Package javax,swing not found in import".
    I have the statement: import javax.swing.*; in my code so I don't what to do again.
    Thanks

    I think your best bet is to try uninstalling and installing Java again. Your problem could be something small, however you wull eaist less time to re-install everything, then to try searching for the problem.
    btw-What Development tool do you use? Just in case you may try to check whether it could be a problem of the ide (It should not be however), just check with another Ide, and see if the same happens. If yes, then follow my first advise, I think it would take you less time.

  • AP Payment Upload Using API or Interface

    Hi ,
    I had requirement to upload the AP payment information using API or Interface. I have the below code. But is showing some "Unexpected" error.
    declare
    p_num_printed_docs NUMBER;
    p_payment_id NUMBER;
    p_paper_doc_num NUMBER;
    p_pmt_ref_num NUMBER;
    p_return_status VARCHAR2(200);
    p_error_ids_tab IBY_DISBURSE_SINGLE_PMT_PKG.trxnErrorIdsTab;
    p_msg_count NUMBER;
    p_msg_data VARCHAR2(200);
    begin
    MO_GLOBAL.SET_POLICY_CONTEXT('S',84); --- Apps intialize
    fnd_global.apps_initialize(1823,20639,200); --- Apps intialize
    IBY_DISBURSE_SINGLE_PMT_PKG.SUBMIT_SINGLE_PAYMENT(
    p_api_version => 1.0,
    p_init_msg_list => fnd_api.g_false,
    p_calling_app_id => 200,
    p_calling_app_payreq_cd => '13011',
    p_is_manual_payment_flag => 'Y',
    p_payment_function => 'PAYABLES_DISB',
    p_internal_bank_account_id => 10000, -----12001,
    p_pay_process_profile_id => 161,
    p_payment_method_cd => 'CLEARING',
    p_legal_entity_id => 23324,
    p_organization_id => 84,
    p_organization_type => '',
    p_payment_date => sysdate,
    p_payment_amount => 111,
    p_payment_currency => 'USD',
    p_payee_party_id => 91678,
    p_payee_party_site_id => 45272,
    p_supplier_site_id => '',
    p_payee_bank_account_id => '',
    p_override_pmt_complete_pt => 'N',
    p_bill_payable_flag => 'N',
    p_anticipated_value_date => '',
    P_MATURITY_DATE => '',
    p_payment_document_id => 1,
    p_paper_document_number => '',
    p_printer_name => '',
    p_print_immediate_flag => '',
    p_transmit_immediate_flag => '',
    x_num_printed_docs => p_num_printed_docs,
    x_payment_id => p_payment_id,
    x_paper_doc_num => p_paper_doc_num,
    x_pmt_ref_num => p_pmt_ref_num,
    x_return_status => p_return_status,
    x_error_ids_tab => p_error_ids_tab,
    x_msg_count => p_msg_count,
    x_msg_data => p_msg_data
    commit;
    DBMS_OUTPUT.put_line ( p_return_status || '---''---' || p_msg_data || '--''--' || p_msg_count );
    IF p_msg_count = 1 THEN
    DBMS_OUTPUT.put_line ( p_return_status || '---''---' || p_msg_data || '--''--' || p_msg_count );
    ELSIF p_msg_count > 1 THEN
    FOR i IN 1..p_msg_count LOOP
    DBMS_OUTPUT.put_line ( i||'. ' || fnd_msg_pub.get (p_encoded => fnd_api.g_false) );
    END LOOP;
    ELSE
    DBMS_OUTPUT.put_line (p_return_status);
    END IF;
    end;
    If anyone knows the solution please respond quickly. This is quite urgent requirement. If I am not using right API then please suggest as well. This requirement for Oracle Apps R12
    Regards,
    Prakash

    Hi,
    Can you please advise if you had a response for your message.
    Regards,
    Sunil

  • I can't use swing components in my applets

    When I write an applet without any swing components, my browser never has any trouble finding the classes it needs, whether they're classes I've written or classes that came with Java. However, when I try to use swing components it cannot find them, because it is looking in the wrong place:
    On my computer I have a directory called C:\Java, into which I installed my Java Development Kit (so Sun's classes are stored in the default location within that directory, wherever that is), and I store my classes in C:\Java\Files\[path depends on package]. My browser gives an error message along the lines of "Cannot find class JFrame at C:\Java\Files\javax\swing\JFrame.class"; it shouldn't be looking for this non-existent directory, it should find the swing components where it finds, for example, the Applet class and the Graphics class.
    Is there any way I can set the classpath on my browser? Are the swing components stored separately from other classes (I'm using the J2SE v1.3)?
    Thanks in advance.

    Without having complete information, it appears that you are running your applets using the browser's VM. Further, I assume you are using either IE or Netscape Navigator pre-v6. In that case, your browser only supports Java 1.1, and Swing was implemented in Java 1.2. You need to use the Java plug-in in order to use the Swing classes (see the Plug-in forum for more information), or else download the Swing classes from Sun and include them in your CLASSPATH.
    HTH,
    Carl Rapson

  • Loading bank accounts with invoices using Payables Open Interface Import

    Dear Gurus,
    We are on 11.5.10.2.
    We create invoices in the 3rd party system, then load them into oracle using payables open interface import process.
    When users create invoices, they choose Vendor and Site first. If the Vendor Site has multiple bank accounts assigned, users may select the one that is non-primary.
    When we load the invoices into Oracle, it finds the PRIMARY account for the particular vendor site, and assigns it to the invoice.
    Is it possible to load bank accounts assigned to invoices into Oracle AP?
    Many Thanks,
    Iana

    Hi,
    No issues for me on Payables Open Invoice Interface with 12.0.6 - and yes make sure you match up the invoice_id on invoice, lines interface tables.
    Regards,
    Gareth

  • How to update an existing supplier using Supplier Open Interface Import?

    Hi
    I need to updated an existing supplier.
    Is it possible to update using supplier open interface import and how?
    Thanks in advance.
    Thanks,
    Mallesh

    Hi Atul,
    I am using CCM 2.0 and SRM 5.0 (EBP5.5).
    We are not using XI, so i guess we cant use the program "/ccm/file_upload".
    we have migrated the product master data from R/3.
    We have developed a report which takes product category as input and gives out flat file in csv format containg all the items in that prod category.
    Then we upload the file in CCM by logging thro the brpwser.
    Similarly, i can develop another program which will give me a CSV file foll all those items changed in R/3 in a day.
    Then we can upload that file in CCM.
    But i have doubt if it will update the existing items in catalog.
    Hope I could make myself clear.
    Thanks
    Abhishek

Maybe you are looking for

  • Internet sharing is slow / not working at all

    Hello everybody and everyone. Something strage has happend with my Internet Sharing.. I discovered it for me since a week. So, I made the whole thing in the Preferences bla-bla-bla.. A week or even more it was working. (I'm using my iPod with the Wi-

  • ProC code- error ORA-1002 fetch out of sequence

    Hi, we have an application currntly running on an HP UX system that uses Oracle 9i database. the pro*C codes work fine with Oracle 9i, on the older system. however now we are migrating it to LINUX system (ORACLE 10g). in the new system we are facing

  • Exception in a Trigger???

    Hi Guru's, Can we handle exceptions in Triggers? Thanks Edited by: user10679113 on Dec 31, 2008 1:29 PM

  • Measure write different time

    Hi: I would like to measure data every 200ms, but only every 600ms I want to write this data in an excel sheet. Does anybody know how to solve it? I tried it with two while loops with different timers, but this doesn't work. Please see my attached VI

  • IMac G5 won't boot to OS X

    Hopefully someone will be able to help as I am currently unable to use my iMac (17" G5 Rev B). Last night I was watching EyeTV and it seemed to crash as I couldn't quit, change channels etc and I was just getting the spinning beachball So I switched