Accessing object of the main class from the thread

Hi, I'm having problem accessing object of the main class from the thread. I have only one Thread and I'm calling log.append() from the Thread. Object log is defined and inicialized in the main class like this:
public Text log;  // Text is SWT component
log = new Text(...);Here is a Thread code:
...while((line = br.readLine())!=null) {
     try {
          log.append(line + "\r\n");
     } catch (SWTException swte) {
          ErrorMsg("SWT error: "+swte.getMessage());
}Error is: org.eclipse.swt.SWTException: Invalid thread access
When I replace log.append(...) with System.out.println(..) it works just fine, so my question is do the log.append(..) the right way.

This is NOT a Java problem but a SWT specific issue.
It is listed on the SWT FAQ page http://www.eclipse.org/swt/faq.php#uithread
For more help with this you need to ask your question on a SWT specific forum, there is not a thing in these forums. This advice isn't just about SWT by the way but for all specific API exceptions/problems. You should take those questions to the forum or mailing list for that API. This forum is for general problems and exceptions arising from using the "core" Java libraries.

Similar Messages

  • [svn:fx-trunk] 12883: Remove the skin classes from the halo theme project to avoid redundancy with the airframework /framework swcs.

    Revision: 12883
    Revision: 12883
    Author:   [email protected]
    Date:     2009-12-12 15:53:50 -0800 (Sat, 12 Dec 2009)
    Log Message:
    Remove the skin classes from the halo theme project to avoid redundancy with the airframework/framework swcs.
    QE notes: No
    Doc notes: No
    Bugs: SDK-24293
    Reviewer: Glenn
    Tests run: Checkintests, smattering of Halo and AIR mustella tests
    Is noteworthy for integration: Yes
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-24293
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/framework/src/FrameworkClasses.as
        flex/sdk/trunk/frameworks/projects/halo/build.xml
    Added Paths:
        flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/WindowBackground.as
    Removed Paths:
        flex/sdk/trunk/frameworks/projects/halo/assets/
        flex/sdk/trunk/frameworks/projects/halo/src/HaloClasses.as
        flex/sdk/trunk/frameworks/projects/halo/src/mx/skins/

  • HT203311 I am use homesharing, but cannot sync the main library from the secondary computer to an iphone.  It shows the entire libaray on the computer, but only shows a few songs when I try to sync iphone with the computer using homesharing.

    I am use homesharing, but cannot sync the main library from the secondary computer to an iphone.  It shows the entire libaray on the computer, but only shows a few songs when I try to sync iphone with the computer using homesharing.

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • "Could ntot find the main class : PdfToImage"

    I am trying to produce a jar that I can execute from the command line. Currently it executes fine if I hit F6 to run the code in the Netbeans IDE.
    I read this article:
         http://java.sun.com/developer/Books/javaprogramming/JAR/basics/run.html
    but still can't get it to run from the command line. The error I get when clicking on the jar file is:
    "Could not find the main class PdfToImage"
    The source code is this:
    package converttoimage2;
    ...import statements here
    public class PdfToImage{
         public static void main(String[] args) {
    To build a jar file I navigated to the NetbeansProjects folder and typed the following (is this wrong?)
         jar cfm PdfToImage.jar ConvertToImage2\manifest.mf ConvertToImage2
    No error messages occured here. The manifest file originally was this (BTW I don't understand what that X-comment is trying to say)
         Manifest-Version: 1.0
         X-COMMENT: Main-Class will be added automatically by build
    so I added this line:
         Main-Class: PdfToImage
    and yes, I pressed Enter at the end of this line. This is the manifest that generates the error. I get the same error this way:
         Main-Class: converttoimage2.PdfToImage
    The code I'm using from the Windows command line to execute the jar (after I copy the jar file to the c-drive) is this:
         java -jar C:\PdfToImage.jar
    This errors out with
         Could not find the main class: PdfToImage
    I've also tried this;
         java C:\PdfToImage.jar
    The next thing i tried was to navigate to the class folder containing the PdfToImage.class. I copied the manifest into this class folder as well.From there I typed:
         jar cfm PdfToImage.jar manifest.mf PdfToImage
    This produced a jar file with no error messages, but I get the original error messsage when I try to execute. Also I doubt this last jar file is complete since it is only 2KB in size (My code references a library called PdfRenderer which is a 2MB jar).
    I'm completely lost here.

    I am trying to produce a jar that I can execute from the command line. Currently it executes fine if I hit F6 to run the code in the Netbeans IDE.You can make a jar from NetBeans, "Build > Build Main Project" (Shortcut - F11). Or right click the project in the project window and select "Build".
    I read this article:
         http://java.sun.com/developer/Books/javaprogramming/JAR/basics/run.html
    OK, if you want to create a jar without Netbeans, then following link would help you a lot:
    [http://java.sun.com/docs/books/tutorial/deployment/jar/index.html]
    Thanks!

  • Deployment - "Could not find the main class."

    I am trying to deploy an executable version of my project. From the IDE, I select Run-Deploy-New Deployment Profile; then I choose JAR File. I leave the default directory, and I've tried various names. I select "Include Manifest File" and then add my main class. I then go to Run-Deploy-[application].deploy. When I try to run the resulting JAR file with javaw, I get the following message:
    Java Virtual Machine Launcher
    Could not find the main class. Program will exit!
    When I try to run it from the command line using java -jar [application].jar, I get this message:
    -jar: illegal argument
    I am using JDev 10.1.3.0.4 on Windows 2000.
    What am I doing wrong?

    If you create a new project in JDeveloper.
    Add a new class
    public class Class1 {
    public static void main(String[] args) {
        System.out.println("It Works");
    [\pre]
    Create a new JAR file
    In the deployment profile point to Class1 as the Main Class
    Deploy the JAR file
    and then from the command line write
    java -jar works.jar Class1
    Does it work?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Is it possible to get the main class name in a Thread context ?

    for example, i want to get the main class name (the first entry of the program).
    public class Test implements Runnable {
         public Test() {}
         public static void main(String[] args) {
              new Thread(new Test()).start();
         public void run() {
              try {
                   //Want to get the main class name (not the current class name)
                   throw new Throwable();
              } catch (Throwable e) {
                   e.printStackTrace();
    }

    Acutally, i wanna make clear about the concept of a "Thread"
    Is it true that ..
    the main() method is a thread , once I create another thread in the program , both of (or all of them) will contains it owns stack exception information ?
    My english is poor, please try to understand it. Thx

  • Referencing main class from created instances

    The quick setup:
    My Main class creates a JFrame and adds a few custom JPanels. One of the JPanels has a mouse listener and responses to the mouse clicks, and it works great.
    I'd like to know if there's a way to have that JPanel invoke public, non-static methods from the Main class (the class which created it) without passing a reference for the instance of the Main class to the JPanel when it's (the JPanel) is created. Or is that the way you're supposed to do it?
    A (sort of) similar question: can a component invoke methods of it's parent container? If so, how?
    Thanks so much,
    Matt

    Hi Rhesus21,
    A (sort of) similar question: can a component invoke methods of it's parent container? If so, how?Yes, simply this way :
    public class MainFrame extends JFrame {
        private MyPanel panel;
        panel = new MyPanel(this);
    public class MyPanel extends JPanel {
        private MainFrame frame;
        public MyPanel(MainFrame frame) {
            this.frame = frame;
    }

  • Could not find the main class - Problem with Webservice-Access

    Hello Everybody,
    I'm having serious Problems with accessing a WebService (Tomcat-Axis) per executable jar-File.
    I constructed a simple GUI with 3 Textboxes 1 Button and 1 Resultbox.
    I use eclipse so it was no Problem to simple generate the Backgroundclient by Processing the .wsdl-File of the WS.
    Now I do this:
    Head_tServiceLocator serviceLocator = new Head_tServiceLocator();
    Head_t service = serviceLocator.getRPCCall();
    RPCCallSoapBindingStub Head_t = (RPCCallSoapBindingStub) service;and use the Webservice like an Object.
    All this works very well.
    Now the Problem:
    Head_t service = serviceLocator.getRPCCall();this Line has to throw a ServiceException.
    If i add a try-catch Block to Process the Message JAVA tells me after i exported to JAR (with Manifest-stuff and so on) and double Click on the JAR the following :
    Could not find the main Class - Program will exit.
    And if i add a throws Declaration to the Methodheader it tells me:
    Fatal Exception Occured - Program will exit
    But if i Comment out that Line at least the GUI is being displayed (so it DOES find the main-Class). But then of course the Webservice won't be accessed.
    All the JARs needed (axis.jar, commons-discovery.jar and so on) are in the same Directory as the Webservice-Client.jar
    Please Help me.
    Greets,
    Zap

    I am not done any typing mistake while creating the jar file i already followed the suggestion that you have mentioned but still the same error .
    This is my MANIFEST.MF file created under META-INF folder
    Manifest-Version: 1.0
    Class-Path: qtjambi-4.4.3_01.jar qtjambi-win32-msvc2005-4.4.3_01.jar
    Created-By: 1.5.0 (Sun Microsystems Inc.)
    Main-Class: Ui_MainWindow
    When i extracted the app.jar following this i got
    1. META-INF folder inside that MAINFEST.MF file the contents i have already placed above
    2. qtjambi-4.4.3_01.jar
    3. qtjambi-win32-msvc2005-4.4.3_01.jar
    4. Ui_MainWindow.class
    Please tell me whats wrong in that i can also give you the app.jar file please let me know the email id ..

  • Is there a way to pass or access the FileGlobal​s of the main sequence from an ActiveX subsequenc​e that runs in parallel?

    I developed an elborate avionics Test Bench using the data types and FileGlobals to define all of my instruments and signals. The instruments have some minor changes between Test Bench's and the signals change between projects. The actual LabVIEW VI's were written so that they would be generic, in nature, and rely on spreadsheets to determine what inputs and expected outputs are to be tested and use the FileGlobals to determine how to process each signal from this extensive data structure. This methodology has worked well so far. Now I have the need to read some of the signals being output by the black box and compute a signal as input. The black box it very particular about the timing related to how fast this input changes in response to the outputs.
    Anyway, I was able to develop another sub-sequence within the main sequence and have it run as a parallel process. The problem that I have is that this extensive FileGlobals data structure is shown in the sub-sequence, but all of the data is zero or blank. What I really need is the FileGlobal data in the sub-sequence to be equal to the FileGlobals data of the main sequence at the time the ActiveX sequence is started OR have some way to access the main sequence FileGlobals from the ActiveX sub-sequence. I was able to use the when doing a Action of "call method" and a moethod of "NewExecution" to start the sub-sequence. The problem is that the data passed was only the first element in the FilGlobals structure and not the entire FileGlobals.
    I have TestStand version 1.0.3 . I know, the answer is usually to upgrade, but I have my own company and am sub-contracting at this company. It took me a month to convince this company that TestStand was the way to go rather than use the old LabVIEW Test Executive that they still have. The point is that it may be difficult to get them to get a later version and at this point I do not have time to wait for a upgrade. So I need to determine an easy way to impliment this with the existing version of TestStand.
    Any pointers on how you might solve this problem would be appreciated. You can email me directly at [email protected] .
    Thank you for your help!

    William,
    As you alluded, TestStand 2.0 has better solutions to this problem than TestStand 1.0.x. These include
    1) Executing the subsequence on a different thread but under the same execution. The file globals are then common to the calling and called sequence. The improved Sequence Call step type gives you this option.
    2) There is a new sequence file property that provides that "All Executions Share the Same File Globals".
    The reason that the file globals are not shared between your 2 sequences is that they are each executed as separate executions. That is, they are each executed using the NewExecution method. With each new execution a run-time copy of the sequence is made, including the file globals.
    I am assuming that you want to execute the subsequence asynchronously (i.e. in parallel) to the MainSequence and therefore must use the NewExecution method to do so. Since you must use TestStand 1.0.3 then the best option is to pass the file globals to the new execution as sequence parameters. It sounds like you tried this but had difficulties. The steps to do this are:
    A) Create parameters in your called sequence that mirror the file globals that you want to pass from your MainSequence.
    B) Create a new data type that is a container. The subproperties of this container must mirror the parameters in your called sequence. It is important that they are in the same order as the parameters.
    C) Create an instance of this container data type as variable.
    D) Pass this variable as the parameter of the NewExecution method.
    I have attached an example of how to do this. I have 2 file globals that I want passed, Number and String. I have another file global that is an instance of the parameter container that I pass with the NewExecution method (could also have made as local variable). Any time I update the values of the container�s subproperty, the changes are available in the executing "subsequence". Therefore, I must update the value of these container subproperties every time I want to have access to new file global values. There is clearly some redundancy here in that my MainSequence must copy the Number and String values to the container subproperties. If fact, it may be better to simply delete the Number and String file globals and simply use the subproperties of the container directly.
    You probably have to play around with the example to synchronize the change of the file globals with the message popups in the subsequence. In TS 2.0 I would have synchronized them with the new synchronization step types.
    Attachments:
    passfileglobals.seq ‏37 KB

  • How do you call a java class from the main method in another class?

    Hi all,
    How do you call a java class from the main() method in another class? Assuming the two class are in the same package.
    Thanks
    SI
    Edited by: okun on May 16, 2010 8:40 PM
    Edited by: okun on May 16, 2010 8:41 PM
    Edited by: okun on May 16, 2010 8:47 PM

    georgemc wrote:
    To answer your impending question, either the method you're calling has to be static, or you need an instance of that other class to invoke it against. Prefer the latterAnd to your impending question after that: no, don't use the Singleton pattern.

  • Java Access Bridge 1.1 Could not find the main class

    When I try to load Java Access Bridge 1.1 I receive the following error:
    Could not find the main class. Program will exit.
    Does anyone know why?

    you must check with the classpath
    please see that you have not repeated %classpath%
    at the end of the class path like you do in win98.
    similiarly with %path%
    in win2000 it is automatically taken care off.

  • How can I access the Attribute Values from the Search Region

    Hi all,
    I have a table which contains Company id, department id, and PositonId. For a particular Company and Department there may be multiple records.
    I have to pupulate a table which contains the position and other details that comes under a particular Department and Position based on the selection in the Three comboBoxes.
    Also I have to populate a select many Shuttle to add new postions and records under a particular Department.
    I created a query panel *(Search Region)* for the serch and a table to display the data. That is working fine.
    Now the issue is I am using a view criteria to populate the shuttle with two bind variables ie, DepartmentId and CompanyId.
    If the serach will return a resuktant set in the table it will also pupulate the correct records, otherwise ie, if the if the serch result is empty the corresponding iterator and the attribute is setting as null.
    SO I want to access the attribute values from the Search Region itsef to populate the shuttle.
    I don't know how can I access the data from the Search Region.
    Please Help.
    Regards,
    Ranjith

    you could access the parameters entered in search region by the user as follows:
    You can get handle to the value entered by the user using queryListener method in af:query.
    You can intercept the values entered as described
    public void onQueryList(QueryEvent queryEvent) {
    // The generated QueryListener replaced by this method
    //#{bindings.ImplicitViewCriteriaQuery.processQuery}
    QueryDescriptor qdes = queryEvent.getDescriptor();
    //get the name of the QueryCriteria
    System.out.println("NAME "+qdes.getName());
    List<Criterion> searchList = qdes.getConjunctionCriterion().getCriterionList();
    for ( Criterion c : searchList) {
    if (c instanceof AttributeCriterion ) {
    AttributeCriterion a = (AttributeCriterion) c;
    a.getValues();
    for ( Object o : a.getValues()){
    System.out.println(o.toString());
    //call default Query Event
    invokeQueryEventMethodExpression("#{bindings.ImplicitViewCriteriaQuery.processQuery}",queryEvent);
    public void onQueryTable(QueryEvent queryEvent) {
    // The generated QueryListener replaced by this method
    //#{bindings.ImplicitViewCriteriaQuery.processQuery}
    QueryDescriptor qdes = queryEvent.getDescriptor();
    //get the name of the QueryCriteria
    System.out.println("NAME "+qdes.getName());
    invokeQueryEventMethodExpression("#{bindings.ImplicitViewCriteriaQuery.processQuery}",queryEvent);
    private void invokeQueryEventMethodExpression(String expression, QueryEvent queryEvent){
    FacesContext fctx = FacesContext.getCurrentInstance();
    ELContext elctx = fctx.getELContext();
    ExpressionFactory efactory = fctx.getApplication().getExpressionFactory();
    MethodExpression me = efactory.createMethodExpression(elctx,expression, Object.class, new Class[]{QueryEvent.class});
    me.invoke(elctx, new Object[]{queryEvent});
    Thanks,
    Navaneeth

  • How to add a code TestIfElse(10) to the Main method of the Program.cs class?

    How to add a code  TestIfElse(10) to the Main method of the Program.cs class?
    Here is my code and I have copied from the Wiley book for Microsoft certification page 14,
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    namespace ifelse_Statement
        class Program
            static void Main(string[] args);
            TestIfElse(10);
            public static void TestIfElse(int n);
            if(n < 10)
                     Console.WriteLine("n is less than 10");
             else if(n < 20)
                    Console.WriteLine("n is less than 20");
             else if(n < 30)
                Console. WriteLine("n is greater than or equal to 30");
    Here is the error list I am getting,
    Error 1      Method must have a return type        C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\switch_Statement\Program.cs
    12 13
    switch_Statement
    Error 2
    Type expected C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\switch_Statement\Program.cs
    12 24
    switch_Statement
    Error 3
    Method must have a return type C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    12 9
    ifelse_Statement
    Error 4
    Type expected C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    12 20
    ifelse_Statement
    Error 5
    Invalid token 'if' in class, struct, or interface member declaration
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    16 9
    ifelse_Statement
    Error 6
    Invalid token '10' in class, struct, or interface member declaration
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    16 16
    ifelse_Statement
    Error 7
    Type expected C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    16 16
    ifelse_Statement
    Error 8
    Invalid token '(' in class, struct, or interface member declaration
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    18 35
    ifelse_Statement
    Error 9
    A namespace cannot directly contain members such as fields or methods
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    20 10
    ifelse_Statement
    Error 10
    Type or namespace definition, or end-of-file expected
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    30 1
    ifelse_Statement
    Error 11
    The type or namespace name 'n' could not be found (are you missing a using directive or an assembly reference?)
    c:\users\pvs\documents\visual studio 2013\projects\lesson01\ifelse_statement\program.cs
    16 12
    ifelse_Statement
    Error 12
    'System.Console.WriteLine(string, params object[])' is a 'method' but is used like a 'type'
    c:\users\pvs\documents\visual studio 2013\projects\lesson01\ifelse_statement\program.cs
    18 26
    ifelse_Statement

    static void Main(string[] args){
    TestIfElse(10);
    public static void TestIfElse(int n)
    if (n < 10)
    Console.WriteLine("n is less than 10");
    else if (n < 20)
    Console.WriteLine("n is less than 20");
    else if (n < 30)
    Console.WriteLine("n is greater than or equal to 30");
    Fouad Roumieh

  • Execute jar file: "could not find the main class" program will terminate

    Hey,
    I am new to Java. I have started to make a small java program which supposed to help me at my studies to lean the Dominic Memory System. I have used the latest version of Netbeans 5.5.1 to build my program in. I have two problems which I cannot figure out how to solve, please help me.
    The first problem is that the java script I have made works when I compile it in Netbeans, but when I create a Jar file it does not work. I receive a pop up message in windows ?could not find the main class program will terminate? when I execute the jar file.
    The second problem I have is that I need to compare the strings generated by the "numbers" and "TIP" and if the numbers is not identical the numbers in the ?Center? JPanel should be highlighted as red.
    If anyone would like to clean up the code I would be pleased. I have copied quite a lot from anyone because of my one lack of knowledge.
    * GoListener.java
    * Created on 12. september 2007, 21:48
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package grandmaster;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.Vector;
    import java.util.StringTokenizer;
    import java.awt.Color;
    * @author Computer
    public class GoListener implements ActionListener {
    private JTextField viewer;
    private JTextField TIP;
    private JTextField freq;
    private JTextField max_num;
    private Vector numbers;
    public GoListener(JTextField j,JTextField k, JTextField m, JTextField f, Vector n) {
    freq = f;
    max_num = m;
    viewer = j;
    numbers = n;
    TIP = k;
    public void actionPerformed(ActionEvent e){
    int time = Integer.valueOf(max_num.getText());
    int f = Integer.valueOf(freq.getText());
    if (e.getActionCommand() == "GO") {
    for (int i = 0; i< time;++i) {
    int number=0;
    number = (int)Math.floor(100*Math.random());
    while(number>51){
    number = (int)Math.floor(100*Math.random());
    if(number<=9){
    viewer.setText(" "+"0" + String.valueOf(number) + " ");
    } else{
    viewer.setText(" " + String.valueOf(number) + " ");
    viewer.paintImmediately(viewer.getBounds());
    numbers.add(number);
    try {
    Thread.sleep(f*1000);
    } catch (Exception exp) {
    viewer.setText(" XX ");
    viewer.paintImmediately(viewer.getBounds());
    if (e.getActionCommand() == "VIEW") {
    try {
    //int numb = Integer.valueOf( TIP.getText() ).intValue();
    StringTokenizer tokenizer = new StringTokenizer(TIP.getText(), " ");
    String[] split = null;
    int tokenCount = tokenizer.countTokens();
    if (tokenCount > 0) {
    split = new String[tokenCount];
    for (int current = 0; current < tokenCount; current++) {
    split[current] = tokenizer.nextToken();
    viewer.setText(" " + String.valueOf(numbers) + " ");
    // k=numbers(1);
    /*while(c<i){
    String.valueOf(k).equals(split[1]);
    c++;
    TIP.setText(" " + split[2] + " ");
    } catch (Exception exp) {
    try {
    //string testit = numb.toString();
    //String str = "" + numb;
    //viewer.setText(str);
    //viewer.setText(numbers.toString());
    numbers.clear();
    } catch (Exception exp) {
    * Main.java
    * Created on 12. september 2007, 21:07
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package grandmaster;
    import java.util.Vector;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.JButton;
    import java.awt.*;
    import grandmaster.GoListener;
    * @author Computer
    public class Main extends JFrame {
    private JTextField viewer;
    public JTextField TIP;
    // private TextInputPanel TIP;
    private Vector numbers;
    /** Creates a new instance of Main */
    public Main() {
    numbers = new Vector();
    JPanel p = new JPanel(new GridLayout(0,4));
    JButton go = new JButton();
    JButton view_num = new JButton();
    go.setText("Go!");
    go.setVisible(true);
    go.setActionCommand("GO");
    view_num.setText("VIEW");
    view_num.setVisible(true);
    view_num.setActionCommand("VIEW");
    JTextField max_num = new JTextField();
    max_num.setText("5");
    JTextField freq = new JTextField();
    freq.setText("1");
    viewer = new JTextField();
    viewer.setText("XX");
    TIP = new JTextField("");
    p.add(go);
    p.add(max_num);
    p.add(freq);
    p.add(view_num);
    getContentPane().add(p,BorderLayout.NORTH);
    getContentPane().add(viewer,BorderLayout.CENTER);
    getContentPane().add(TIP,BorderLayout.SOUTH);
    setSize(200,200);
    GoListener g = new GoListener(viewer,TIP,max_num, freq, numbers);
    go.addActionListener(g);
    view_num.addActionListener(g);
    * @param args the command line arguments
    public static void main(String[] args) {
    // TODO code application logic here
    Main window = new Main();
    window.setVisible(true);
    }

    NetBeans questions should be posted to the NB site. It has mailing lists and associated forums.
    This tutorial from the NB site addresses running programs outside of NB
    http://www.netbeans.org/kb/articles/javase-deploy.html
    When you compare objects, use ".equals()" and reserve == for comparing values.

  • I want to call External Java class from the PL/SQL

    Hi,
    I am using Oracle Apps R11i (11.5.7), I wanted to call external Java class from the PL/SQL. This external Java class is residing in another application server.
    How do I do this.
    I know one way. Develop C routine in Oracle Apps to call external java class and call this C routine from the PL/SQL.
    Is there any simple method available? or any other method?
    Thanks in advance.
    -Venkat

    First of all, this is a Java application you're talking about, right (i.e. it has a main() function)? It's not just a class that you're trying to instantiate is it? If it's an application, you obviously have to start a new virtual machine to run it (rather than using the virtual machine built into the database like stored java). I'm a little leary of your mention of an "application server" as this would more commonly mean that a virtual machine is already over there running with access to this class. In which case, you'd typically interface with SOAP or some other RPC API.
    All that aside, as long as you have physical disc access (through NFS or whatever) to the class file, you could use a java wrapper class with a system call to do this. In fact, there is a thread in just the last day or so on this very forum that has the code to do just that (see " Invoking OS Commands from PL/SQL"). However, it's worth noting that the virtual machine will be running on the database server in this case and not the application server.

Maybe you are looking for