What is the easiest way to show a command line app in an appletviewer

I'd like to convert a command line interface application to a small applet, for use in an appletviewer. What is the easiest way to implement this.

I made something like what you are describing for a text adventure engine. It uses a big text area for output and a small text field for input.
Here's the code
public class myApplet extends java.applet.Applet
     implements Runnable
     TextArea output ;
     TextField input ;
public void init()
          width = this.size().width ;
          height = this.size().height ;
     public void run()
          makeComponents() ;
          while( true ) // loop on + on + on
          try { Thread.sleep( 10 ) ; }
                    catch (InterruptedException e) {}
public void makeComponents()
          input = new TextField() ;
          input.setSize( Math.min( 200, width - 5 ), 25 ) ;
          input.setLocation( 5, height - 30 ) ;
          add( input ) ;
          input.addActionListener( new ActionListener()
               public void actionPerformed( ActionEvent e )
                    String temp = input.getText() ; // do something with this
          output = new TextArea( "", 0, 0, TextArea.SCROLLBARS_VERTICAL_ONLY) ;
          output.setSize( width - 10, height - 40 ) ;
          output.setLocation( 5, 5 ) ;
          add( output ) ;

Similar Messages

  • What's the easiest way to show query results?

    I have a button on the Business Partner form, and I want to show the results of a query when you push it.  What's the easiest way to show this data to the user?
    Am I going to have to create a new form and add a matrix to it?  There has to be an easier way.

    Hi Bryan,
    If the query is without parameter, you can activate the menu for this query, else I think the best way is a new form with a grid (much faster than matrix).
    Regards
    Ad

  • What's the easiest way to remove/append a line of a text file???

    The line to remove can be any line in the file - not only the first or last one.
    Is there any good tutorial for file operations?
    Thanks a million,
    Serano.

    To remove a line from a text file, the easiest way is to read it in one line at a time and write out all lines except the one you want to remove to a new version of the file. Likewise, to insert a line, you read the file one line at a time and write the lines to a new version, inserting the new line at its correct spot.

  • What is the easiest way to add a slide show to a dream weaver page?

    What is the easiest way to add a slide show to a dream weaver page?

    Copy & paste the following code into a new, blank document.  Change images to your own.  SaveAs test.html and preview in browsers. 
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>HTML5 with Cycle2</title>
    <!--help for older IE browsers-->
    <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <!--Latest jQuery Core Library-->
    <script src="http://code.jquery.com/jquery-latest.min.js">
    </script>
    <!--Cycle2 Slideshow Plugin-->
    <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery.cycle2/20130409/jquery.cycle2.min.js"></script>
    <style>
    /**Slideshow**/
    .cycle-slideshow {
        position: relative;
        z-index: 1;
        width: 400px; /**adjust width as required**/
        margin:75px auto;
        text-align: center;
    .cycle-slideshow img { max-width: 100% }
    /* prev / next links */
    .cycle-prev, .cycle-next {
        position: absolute;
        top: 0;
        width: 20%;
        opacity: 0;
        filter: alpha(opacity=0);
        z-index: 800;
        height: 100%;
        cursor: pointer;
    .cycle-prev {
        left: 0;
        background: url(http://malsup.github.com/images/left.png) 50% 50% no-repeat;
    .cycle-next {
        right: 0;
        background: url(http://malsup.github.com/images/right.png) 50% 50% no-repeat;
    .cycle-prev:hover, .cycle-next:hover {
        opacity: .7;
        filter: alpha(opacity=70)
    /**END SLIDESHOW STYLES**/
    </style>
    </head>
    <body>
    <h1><a href="http://jquery.malsup.com/cycle2/">JQuery Cycle2</a></h1>
    <!--begin slideshow-->
    <div class="cycle-slideshow"
        data-cycle-fx="fade"
        data-cycle-timeOut="2000"
        >
    <!-- prev/next links -->
    <div class="cycle-prev"></div>
    <div class="cycle-next"></div>
    <!--insert your images below-->
    <img src="http://jquery.malsup.com/cycle2/images/p1.jpg" alt="description">
    <img src="http://jquery.malsup.com/cycle2/images/p2.jpg" alt="description">
    <img src="http://jquery.malsup.com/cycle2/images/p3.jpg" alt="description">
    <img src="http://jquery.malsup.com/cycle2/images/p4.jpg" alt="description">
    <p>Mouse over image for previous / next links</p>
    </div>
    <!--end slideshow-->
    </body>
    </html>
    Nancy O.

  • What's the easiest way to add storage to a mac mini. (1TB hard drive but only 32G of real storage). External device, internal or partitioning?

    What's the easiest way to add storage to a mac mini. (1TB hard drive but only 32G of real storage). External device, internal or is there some way to partition? I tried doing so but received a message that there wasn't enough free space to partition. Seems like a 1TB drive should have more storage than my Ipad

    Its worth confirming what free space you have on your drive: 
    go to:   Apple Menu > About this Mac >  More Info > Storage
    The bar chart shows how much free space there is on the drive:
    Please realise that partitioning does not create extra space so this wont help you.
    If your free space is less than 20 % you should get extra storage with an external USB or Firewire drive, any make or model will work.

  • I have a new iMac. I have set up a user page for myself, for my wife and an administrator page. My question is my wife needs files from my user page transferred to her page. What's the easiest way?

    I have a new iMac. I have set up a user page for myself, for my wife and an administrator page. My question is my wife needs files from my user page transferred to her page. What's the easiest way?

    I've done this by dragging files from my user page to her drop box. In Finder, drag the required files and hover over the hard disc icon in the navigation bar on the left. As you hover, it will open another finder window showing the contents. Work your way down these windows into <Her username | Public | Dropbox>. Drop the files into the dropbox. She can then retrieve them from her user page.
    Good luck,
    Stephen

  • What is the easiest way to wrap photos with text in ps CS4?

    What is the easiest way to wrap photos with text in ps CS4?

    InDesign handles text much better that either Illustrator or Photoshop.
    In InDesign there is more than one way to put a frame around a paragraph:
    Select the text frame, go to Object menu - Text Frame Options and set the Inset Spacing to keep the text away from the frame edge.
    Then select the text frame with the selection tool (black arrow) check the Fill/Stroke icon at the bottom or the tool box and make sure the Stroke is selected, and choose a Stroke width from the tool bar at the top of the screen.
    Or you can do it a quick and dirty way by just drawing another frame and place it on top of the text frame. Give this frame a Stroke and make sure the Fill is set to None.
    I selected both frames in this example simply to show that they are two separate frames. The first method (above) only produces one frame.
    Your original question was regarding text wrap, the third example shows text wrapping around the photo.
    Place or type your text. Place your image and go to the Window menu - Text Wrap. You can set the Offset margins individually to keep the text away from the edge of the image.
    For things like this InDesign is definitely the best way to go.

  • What's the easiest way to embed a video into a specific part of an image map?

    What's the easiest way to embed a video into a specific part of an image map?
    Anybody help? Is there a way to do this in Dreamweaver?

    One way would be to create your image map first. Then, use the CSS property position to position the div containing the video player relative to the image map or absolute to the page (depending on how your website layout is).
    Then, use an event listener (javascript) to enable the div holding the video player to show only when the specific area on the image map is clicked.

  • What's the easiest way to do this?

    hey, my music videos are included in the lists of songs, which usually cause my iPod to freeze. what's the easiest way to get them out of my songs lists so that they only show up when i go to Videos. should I just change the names of the music video artists so they don't get mixed in with songs, or is there an easier way to do this that i am missing?

    why restore it? does this not happen to everyone? i thought it was just my fault for giving the same artist names for songs and videos...

  • I am using Iphoto 11 ver 9.4.3 on mac using oxs 10.8.5 i want to export calendar projects to an external hard drive. what is the easiest way to do this? i have tried export and import but it didn't seem to work.

    I am using Iphoto 11 ver 9.4.3 on mac using oxs 10.8.5 i want to export calendar projects to an external hard drive. my goal is to store them in an external hard drive so it doesn't use up memory on the mac hard drive. is it possible to copy the specific projects without copying the entire library? what is the easiest way to do this? i have tried export and import but it didn't seem to work.

    What do you not understand?
    You can duplicate the iPhoto library (command - D ) and delete everything except the project and its photos from the copy and move that
    Or
    However the calendar takes very little space - it is simpy database entries - it is the photos in the calendar that take space - and for most people you would wnat to keep those photos in your library
    you can use a photo in 50 calendars and it still is only one photo in your library - as I explained calenders do not exist as such - they are simply database entries telling iPhotop how to display the calendar - they take almost no space at all
    LN

  • What is the easiest way to create and manage very big forms?

    I need to create a form that will contain few hundred questions. Could you please give me some advise on what is the easiest way to do that? I mean for example is it easier to create everything in Word (since it is easier to manage) and than create a form based on that?
    My concern is that when I will have a very big form, containing different kinds of questions and with many scripts, managing it during work will be slow and difficult, for example adding a question in the middle of the form which would require moving half of the questions down which could smash the layout etc.
    What is the best practise for that?
    Thanks in advance

    Try using Table and Rows for this kind of forms. These forms will have the same look throught with a question and and answer section..
    In the future if you want to add a new section, you can simply add rows in between..
    Thanks
    Srini

  • I want to use 1 itunes account but with 3 different iphones 2 for the kids and one for me, what is the easiest way to do that?

    I want to use 1 itunes account but sync 3 different iphones, 2 for the kids and 1 for me.  So I would like to have different programs, songs, apps etc for each phone.  What is the easiest way to do that

    Agreed heather. Also, if you have three users on the same account how do you keep phone calls and messages from going to all three phones?

  • I have a mid year 2007 24 inch iMac and will be purchasing a new 27 inch Retina iMac, what is the easiest way to transfer the data and files from my old machine to the new one?

    I have a mid year 2007 24 inch iMac and will be purchasing a new 27 inch Retina iMac, what is the easiest way to transfer the data and files from my old machine to the new one?

    Following up on this thread,
    I have a new iMac on the way and my current is from 2008, never had a problem but I am sure there are internal issues that I would prefer not to transfer.
    I have no issues other then the slowness in certain programs and that is the main reason to buy a new one.
    Programs like numbers and pages seem to take a longer time to open after I update to Yosemite.
    I only use 272GB of 500 GB, my memory is 4GB and I am upgrading to 8Gb and bought the 4.0 processor.
    Question:
    Is there a way to manually transfer items or would that be a waste of time in that if there are issues they could be anywhere and would transfer anyway?

  • What is the easiest way to burn imovies onto DVD's.   I want to burn more than one movie onto DVD as I create.    Can I continue to burn onto the same DVD as the movies are created?

    What is the easiest way to burn my imovies onto DVD's?    I want to burn movies as I create them and then continue to add more movies to the same DVD as the years go by -- until the DVD is full!    Is this possible?

    You might also want to post this in the iMovie forum https://discussions.apple.com/community/ilife/imovie

  • What is the easiest way to transfer a large imovie project from one computer to another in a different location.

    What is the easiest way to transfer an faairly large HD imovie project from one computer to another in a different location. Can you export to drop box? Will the other computer need the exact imovie version?

    OK it depends.
    If you have a finished movie, you can SHARE/EXPORT MOVIE and create your final movie. Then, depending on the size of the finished movie, you can transfer via dropbox or similar service. Ninety minutes is a very long movie for iMovie, but it may work for you. I would suggest 720P to keep the size down.
    If you need to transfer the entire iMovie Project so it can be edited in iMovie at the other end, then you need to transfer the project and event assets to an external hard drive and get the hard drive to the other location.
    Directions are here. Follow the directions for 1) Moving or copying Project to external drive. Then 2) Consolidate Media.
    https://discussions.apple.com/docs/DOC-4141

Maybe you are looking for

  • How to put images on buttons?

    I am currently working a project and need to mount an image onto a button, so when the image is clicked on it makes the button event work?

  • Showing Data in Oracle Discoverer Desktop

    Dear ALL, I am facing an issue in development of Relational reports in Oracle Discoverer Desktop. Following are the details of my warehouse (Data Mart) database: There are 2 Dimensions and 1 cube in the Data Mart. All the 2 dimensions and Cube are ba

  • When I click on any object, Indesign opens endless documents (not always)

    Sometimes when I'm working in Indesign, I click any kind of object (square, type, etc.) and suddenly 20 documents (that I previously worked on) opens and I can't return to the original document.

  • Q: Increase the heap space for ant...set ANT_OPTS..where??

    In trying to resolve the out of memory error I get when running Ant on a large project of mine I cam across this post http://tech.groups.yahoo.com/group/flexcoders/message/102140 set the following environment variable before the build depending on yo

  • My processer won't run the new update ?

    I have an iBook G4. After downloading the new version of Firefox it will not run so I have to continue with the older version. I continuously get messages telling me my version is out of date which is getting annoying. Apple want me to buy a new comp