Integrating Another Program Into A Java GUI

HI
I have 3 classes here. One is a Java GUI, the other two are involed in
stripping and processing of information off a webpage.
Of these latter two classes, one contains a main method which connects
to a webpage and reads the info off it, it calls the other class which
parses this information and holds the variables I need to create
buttons for the main gui!
Is it possible at all to integrate, the class that reads the webpage,
into, the Java GUI class.I need to do this to access the variables
that the parsing class is holding, as previously I have had to create
an instance of this class in the webpage reader class, but this was no
good to me as the GUI could not access this information, i.e can I
create an instance of this stripper at the begining of main in the GUI
class so as I can use the results for this for producing my buttons?
I've tried to do this but I am getting unresolved symbol errors. I was
wondering should I use global variables to hold the needed info also ?
Any help at all greatly appreciated,
Thanks
Gerry

I did what you're describing. Sounded simple enough. You put the same logic in main() into the applets init() and you can run as app or applet. Worked well in my IDE. Then the troubles start.
Visit
http://www.martinrinehart.com
and read the Article, Launching Applets. That will get you started on launching a Swing application. (Try my Sample, DawnPainter, to give you an idea about how nice this can be when it works.) I promise but don't deliver (yet) an article on the javascript library I wrote that solves all the problems. For non-commercial use you can get your own copy:
http://www.martinrinehart.com/examples/launchApplet.js

Similar Messages

  • How can I run C programs under a Java GUI?

    Hi
    I'm looking for some info on how to run a command line program written in another language behind a Java GUI, any advice greatly appreciated, particularly in how to transfer data between the two.
    Thanks

    Runtime.getRuntime().exec(...)
    Transfering info is more complicated. Maybe write and read status from disk?

  • How to capture the output of another program into a File/String

    I needed to capture the output of a dos program in an String/file I tried doing Runtime.getRuntime.exec("ipconfig /all >tmp.txt");
    but still I am unable to capture the output frm the program which I would like to capture in a file or String.Can anyone help

    When you use the Runtime.exec() method, it returns a Process object, that process object has access to the streams; stdout, stdin, and stderr of the application you just executed. what you'll want to monitor is the stdout or stderr streams using the
    p.getInputStream() or p.getErrorStream(), where p = the process object returned via the Runtime.exe() method.

  • Executing Javascript into java GUI

    Hello Everyone
    I need to make some gauges and indicators to be shown in a java gui industrial application. I did not found good and free(that permits using the library in commercial apps) libraries for importing gauges and indicators in java.
    I have found a very good site, that offers some free nice gauges written in javascript and intended to be shown on html pages:
    http://www.bindows.net/free_gauges/
    Is not there any workaround to import such javascript gauges into a java GUI application ??
    Thanks

    "The Mozilla Rhino engine for the JavaScript programming language, however, is currently included as a feature in the JDK 6 and JRE 6 libraries." (source: http://java.sun.com/developer/technicalArticles/J2SE/Desktop/scripting/)
    However, the problem here is that Java is not a web browser. These GUI elements would likely make use of HTML, CSS and APIs that are only implemented in a browser. To use them outside of a browser would, as already stated, require most of a browser to be coded. Quite a large effort just for some pretty GUI elements.

  • How to make changes in another program?

    Hi evrybody,
    how  to make changes from one program  to another program ?
    Changes should be reflecting in other program.
    thanx in advance n wud be surely Rewarded if answer is helpful.

    Hi Bharat,
    Thanx for the info.
    But what my requirement is , I'm scanning & reading another report into an Internal table. I want to change the Hyphen's
    '-' used in variable declarations of another program into Underscore '_' .
    My sample code is like this..
    Report Zmain.
    PARAMETERS:
      p_prog LIKE sy-repid,
      p_key LIKE stokex-str.
    Internal Table t_itab                                                *
    DATA:
      BEGIN OF t_itab OCCURS 0,
        line(256) TYPE c,
      END OF t_itab.
    *" Data declarations...................................................
    DATA:
      t_statements LIKE sstmnt OCCURS 0 WITH HEADER LINE,
      t_levels LIKE slevel     OCCURS 0 WITH HEADER LINE,
      t_tokens TYPE stokesx    OCCURS 0 WITH HEADER LINE,
      t_keywords LIKE t_itab   OCCURS 0 WITH HEADER LINE,
      w_i TYPE i,
      w_j TYPE i.
                            START-OF-SELECTION                           *
    START-OF-SELECTION.
      APPEND p_key TO t_keywords.
      READ REPORT p_prog INTO t_itab.
      SCAN ABAP-SOURCE t_itab
      STATEMENTS INTO t_statements
      LEVELS INTO t_levels
      TOKENS INTO t_tokens
      KEYWORDS FROM t_keywords
      WITH INCLUDES
      WITH ANALYSIS
      WITH COMMENTS.
                            END-OF-SELECTION                             *
    END-OF-SELECTION.
      LOOP AT t_statements.
        READ TABLE t_levels INDEX t_statements-level.
        w_i = t_statements-from.
        w_j = t_statements-to.
       IF t_statements-level > 0.
        WHILE w_i < w_j.
          READ TABLE t_tokens INDEX w_i.
          REPLACE '-' WITH '_' INTO t_tokens-str.
          w_i = w_i + 1.
        ENDWHILE.
       ENDIF.
      ENDLOOP.
    My called program is like this....
    Report Zcalled.
    DATA:
      w-var1 TYPE c,
      w-var2 TYPE c.
    DATA:
      fs_flight1 TYPE sflight,
      t_flight1 LIKE STANDARD TABLE OF sflight.
    START-OF-SELECTION.
      INCLUDE zinclude3.
      SELECT * FROM sflight
        INTO TABLE t_flight1
        WHERE carrid = 'AA'.
      SELECT * FROM sflight
       INTO TABLE t_flight1
       WHERE carrid = 'LH'.
    END-OF-SELECTION.
      LOOP AT t_flight1 INTO fs_flight1.
        WRITE: / fs_flight1-carrid,
                 fs_flight1-connid,
                 fs_flight1-fldate,
                 fs_flight1-price.
      ENDLOOP.
    Thanx very much.

  • Reading the output from another program.

    I haven't used Java in a good long while so I need someone to point me in the right direction. I have a C program that I call from a command line (windoze boxen) and it spits out some neat data. I can call it from inside a Java program, but how do I then read the output from the calling Java program? I'd just alter the C program, but I lost the source.

    This article explains how to correctly execute another program from your
    Java program, and read its output:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Including one program into another

    I have a big java program and it contains lot of data declarations. I want to have all these declarations in another java program and include that program into my main prorgram. How do i do it??
    Please help me out in this.
    Thanks in advance...

    iconabhi wrote:
    Well,Can i create another java program and put all the declarations in that program and then include this program in the main program which uses the data declarations?Your usage of the term "java program" is unclear at best. What do you mean? Are you talking about a class?
    What kind of declarations are that? Can you give us an example and tell us aproximately how many there are of those?
    If you don't provide more details your question can only be answered by guesswork and thus the answers won't be of much use to you.
    Also, if you find a few minutes, you might want to read http://www.catb.org/~esr/faqs/smart-questions.html
    regards

  • JavaService - can install java program into win2k service, but cannot run

    i have a JavaService problem: i can install java program into win2k service, but cannot run
    the version of javaservice is 2.0.7.0
    the following is the message:
    C:\DailyUpdate\dist>JavaService.exe -install DailyUpdate C:\Program Files\Java\j
    dk1.5.0_05\jre\bin\client\jvm.dll -Djava.class.path=C:\DailyUpdate\dist\ftpbean.
    jar;C:\DailyUpdate\dist\mysql-connector-java-3.0.10-stable-bin.jar;C:\DailyUpdat
    e\dist\DailyUpdater.jar -Xms16M -Xmx64M -start DailyUpdateHandler -params C:\Dai
    lyUpdate\dist -out C:\DailyUpdate\dist\logs\out.log -err C:\DailyUpdate\dist\lo
    gs\err.log
    The DailyUpdate automatic service was successfully installed
    The DailyUpdate service is starting.
    The DailyUpdate service could not be started.
    The service did not report an error.
    More help is available by typing NET HELPMSG 3534.

    I might be doing some programming for my company soon
    which will require a program to monitor a database
    and whenever there is a change to certain fields, it
    must copy certain fields into another database. When I see "whenever thiere is a change to certain fields" I tend to think "triggers" - but maybe this won't work for you 'cause of the "another database" part. And the fact that triggers are inherently evil.
    [snip]
    Is it possible to run a Java program as a windows
    service? And if so then how would you go about it? I'd hit Google - there're a couple ways to do this.
    [snip]
    Also,...if I were to use one of those programs which
    can make an .exe of a Java program, then do you still
    require the JRE to be on the machine? It depends on how you did the conversion. If you compile to native then no, if you just wrap up a JRE then yes.
    Why I ask is
    that I occasionally get asked to do small development
    projects for my company, but we are a microsoft
    partner and therefore do all the development in C#
    and the like. So I would like to just implement as
    many things in Java as I can, just to show everyone
    that Java can do exactly what C# can do. But its
    difficult to convince people of this since I always
    require the JRE and they dont. Of course, they require the .NET framework and you don't. And last I looked that thing was around 23 Meg.

  • Possible? output a string from a java program into a running program

    I'm not sure if it is plausible, but this is my dilemma. My java program searches for street names in a specific region, then outputs the nearest street. I would like to synch this up with Google Earth, and output the street name into it, so it would go ahead and be able to search it right away. Is this possible, or should I attempt some other route?

    Check out my runCmd method. It gives an example of running another program and listening for the output. I built this to run javac and show the output in my custom editor.
    You'll see some classes in here that are not standard java classes, in particular InfoFetcher. Don't worry, this is just a utility I wrote for convenient handling of inputstreams. You can handle the inputstreams without it, but if you really want it, it's probably posted somewhere in these forums.
            private void runCmd(String cmd) {
                 try {
                      System.out.println("cmd: " + cmd);
                      Process p = Runtime.getRuntime().exec(cmd);
                      InputStream stream = p.getInputStream();
                      InputStream stream2 = p.getErrorStream();
                      InfoFetcher info = new InfoFetcher(stream, new byte[512], 500);
                      InputStreamListener l = new InputStreamListener() {
                           int currentLength = 0;
                           public void gotAll(InputStreamEvent ev) {}
                           public void gotMore(InputStreamEvent ev) {
                                String str = new String(ev.buffer, currentLength, ev.getBytesRetrieved());
                                currentLength = ev.getBytesRetrieved();
                                System.out.print(str);
                      info.addInputStreamListener(l);
                      Thread t = new Thread(info);
                      t.start();
                        InfoFetcher info2 = new InfoFetcher(stream2, new byte[512], 500);
                      InputStreamListener l2 = new InputStreamListener() {
                           int currentLength = 0;
                           public void gotAll(InputStreamEvent ev) {}
                           public void gotMore(InputStreamEvent ev) {
                                String str = new String(ev.buffer, currentLength, ev.getBytesRetrieved());
                                currentLength = ev.getBytesRetrieved();
                                System.out.print("(Error) " + str);
                      info2.addInputStreamListener(l2);
                      Thread t2 = new Thread(info2);
                      t2.start();
                 catch (IOException iox) {
                      iox.printStackTrace();
            }

  • How to open-up a pdf file to a particular page via java? (file and page number from another program)

    I have created an Access 2003 Form. Data is entered. The data can be viewed once entered in the same form format, with one addition. The addition is a link to another program where we store files. The files stored are pdf documents. Each document is a scanned file (500+ pages). The link can open-up the pdf file. I want the link to open-up the pdf file to a particular page. I will supply the page number from the database.
    I am aware of Adobe Acrobat 7.0 PDF Open Parameters using a URL that specifies the file to be opened plus actions to be performed once the file is openend (i.e. http://example.org/doc.pdf#page=3). However, the 3rd party program transfers a file from a server to the client via java. The file does not go via a web browser. The java code transfer the file directly from the file server to the the client.
    Any idea how to accomplish the task of viewing a particular page with the process flow described?
    I am using Adobe Acrobat 7.0 Professional.

    So you are reading this file in a standalone version of Acrobat? If so then use the PDF Open Parameters /a option via the command line.
    Sabian
    Example:
    C:\Program Files\Adobe\Acrobat 7.0\Acrobat>Acrobat.exe /A "zoom=1000=OpenActions" "C:\Program Files\Adobe\Acrobat 7.0\Acrobat\SimpleSubmit.pdf"
    Where:
    Path to Acrobat: C:\Program Files\Adobe\Acrobat 7.0\Acrobat>Acrobat.exe
    Note: The example starts in the Acrobat application directory
    Switch: /A
    Parameter Syntax: "zoom=1000=OpenActions"
    Path to file: "C:\Program Files\Adobe\Acrobat 7.0\Acrobat\SimpleSubmit.pdf"
    Note: The quotes are very important for the syntax to work appropriately.

  • Import iCal into another program

    Is it possible to export a calendar that's in iCal and import it into another program? In other words is there a way to share my calendar with a non-mac user other than through a .MAC account?

    With the release of iCal 3 in Mac OS X 10.5 and iCal Server with Mac OS X 10.5 Server in the near future, this will be possible, as iCal has been rewritten to conform with the the emerging CalDAV standard. It's not possible to do using iCal at the moment, as it does not have the capability to host read-write calendar objects.
    There is an open-source version of the iCal Server: Darwin Calendar Server.
    You won't need .Mac to do this, but in any event, .Mac cannot interact with computers not running OS X, eliminating the one you want to share calendar data with.

  • Using Java to Log Data from another program

    I have a program that I want to log data from while the program is running. The program has a textarea that gets updated with data from the internet. I want to be able to read this textarea and store the data so it can be analyzed later.
    I don't know what the program was written in, only that it is running on Windows.
    Can Java "watch and read" another program?

    i think that easyest way would be to listen for network traffic and then parse relevant information from there...
    you could make a java app to act as proxy for that programm (maybe) and then log everything that goes through socket, or if you don't want to do that, then you could also use some other software that can listen network and look from there information that intrests you...
    of other softwares id recommend somekind of Iris soft that i used 3-4 years ago... realy easy to use nd runs on windows as well... even better would be ngrep, but i don't know if it has any windows versions...

  • Itz possible to call one report program into another program

    hi guys,
                i had a doubt that can i call a report program into another report program by declaring their name into the second program like as we calling Includes ,function modules and like class and their methods .
    if  anybody done this or know how to do this,  give me the details and explination about this  friends
    if it possible with screenshots and codings
    Thanks & Regards
    Saigijeo

    Please search before posting, do not ask basic questions here.
    Always do your own work before turning to the community with specific problems.
    Thread locked.
    Thomas
    [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]

  • Can we call sceen of one program into another?

    Hi ABAPers,
      I wish to know whether, is it possible to call the screen of one program through another program? I know, calling a subroutine of a program from another is possible but i want to know whether calling screen of one program from another is possible or not?
      Also if its possible then how?
    Regards,
    Sonu.

    Hi,
    We can call the subscreens ...
    CALL SUBSCREEN <area> INCLUDING [<prog>] <dynnr>.
    The screen of a subscreen that you call is placed in the subscreen area <area> on the main screen.
    If you do not specify a program <prog>, the system uses a screen from the current ABAP program. If you do specify a program <prog>, the system uses a screen from the program <prog> for the subscreen. This program is treated in the same way as an external subroutine call. In other words, it is loaded into the program group of the calling program, or, if it is a function group, as its own program group in the same internal session as the calling ABAP program.
    Regards
    Sudheer

  • Calling another application from a java program

    Hi, Java ppl.
    I wanted to know how can I call another program say a help application or an exe from a java program. anyone with any advice or a piece of code would help.
    Thanks
    Pradeep

    I had the same situation and I tried the code that you sugested and it works. I was wondering, what am I expecting in the while loop that appears after the int inp; statement? Is some data going to be displayed on the screen? How essential is to have that while loop after the calling the exec() method?
    Sorry for the amount of questions, I never tried this before.
    Best regards,
    Luis E.

Maybe you are looking for

  • Stock Management and stocking units

    Good morning, We need to manage item stocks in two units: kilograms and item units. (kilograms to stock valuation, but units to count the items). For instance, when performing a delivery (sales), we need to issue item units, but the price the items h

  • Please help with layers

    Hi TOTALLY new to flash but ive just followed this tutorial Snow I have added some of my own graphics to the above tutorial to suit my needs. The problem I'm having is that the snow ALWAYS appears above all other graphics. I want the 'snow' to be und

  • I can't uninstall the Firefox beta

    The Firefox beta doesn't work. Therefore I will uninstall it. But I cannot, becauseadialog panel says: you must first close firefox. But it is closed. What can I do?

  • Unable to lanch forms in R12 (getting frm-92050)

    I have installed oracle r12 on rhel5. the ip address of server is 192.168.1.100 i am able to login to oracle apps and see the self service pages in all responsibilities. how ever when i try to open any of the forms i am getting an error FRM-92050 : F

  • Java.policy.applet --- how to emulate common browser environment

    Hi, what right shall I grant for my applet development if I want to run and test in the environment that corresponds to the common browsers? (FF, IE, Opera)? When I grant nothing I get error, but it runs ok in browsers => there must be some right gra