OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Java App Launcher, Launch Java Apps without installation
rrashkin
post Sep 16 2004, 06:56 AM
Post #1





Group: Members
Posts: 67
Joined: 10-December 03
From: Colorado
Member No.: 1,134



Greeting all.
This may not be interesting to anyone else but I like it:
I have several Java apps that I wrote for various reasons. I really find the whole IPK thing a major hassle as these are really just for me. I was content for a while to run my apps from the console (I wrote a bash script to list my classes and give me a choice) but it ocurred to me that it would be good to have a "launcher app" that I could put on the desktop that would read a text file (zlnch.txt) of otherwise stand-alone apps and luanch them. That way, any new app I write, I just copy the classes off to my CF card and edit the text file and I'm done. The apps need to have a argument-less constructor and basically do nothing in "main" but call the constructor.

So, anyway, if anyone is interested:
CODE
import java.awt.*;
import java.awt.event.*;
import java.io.*;

class jlnch extends Frame  {
//    class data
static TextField appnm;
static String rs;
static Choice apln=new Choice();
//    main method
    public static void main(String args[]) throws IOException {
    //Initilaize
   apln.add("");
       BufferedReader iniFile = new BufferedReader(new FileReader("zlnch.txt"));
       while ((rs =iniFile.readLine()) != null) {apln.add(rs);}
       apln.addItemListener(new ItemListener(){
            public void itemStateChanged(ItemEvent e)  {
                   String ct = apln.getSelectedItem();
                   try {
                           Class cls = Class.forName(ct);
                           cls.newInstance();
                   }
                   catch (ClassNotFoundException e2) { }
                   catch (IllegalAccessException e3) { }
                   catch (InstantiationException e4) { }
            }
       });
    //call constructor
        jlnch jl1 = new jlnch();
    }
//   constructor method
     public jlnch() {
 setTitle("app launcher");
 addWindowListener(new WindowAdapter() {
     public void windowClosing(WindowEvent e) {
   System.exit(0);
     }
 });
         ScrollPane sp = new ScrollPane();
         Panel p0 = new Panel();
         p0.setLayout(new GridLayout(1,0));
         p0.add(apln);
         //
         sp.add(p0);
         sp.setSize(200,40);
         add("Center", sp);
     pack();
 show();
     }
}
Go to the top of the page
 
+Quote Post
Omicron
post Oct 10 2004, 05:22 AM
Post #2





Group: Members
Posts: 608
Joined: 14-April 04
Member No.: 2,853



Nice idea for quick Development deployment when IPK is not a high priority and you don't want to bother installing and uninstalling every version of the IPK for each change.

Now all you need to do is wrap up your bash file with some online docs and an Icon and make an IPK out of it. Seriously. Then you could upload it and it's online help would explain the file to modify (or just a simple GUI if the file is empty or perhaps a 3 second dump of the file and its location prior to launch). Then developers will find it intuitive, easy to use and it will find a much wider use.
Go to the top of the page
 
+Quote Post
rrashkin
post Oct 12 2004, 10:13 AM
Post #3





Group: Members
Posts: 67
Joined: 10-December 03
From: Colorado
Member No.: 1,134



Omicron,
I don't understand your suggestion. Which BASH file should be wrapped up with doc's? Furthermore, making an IPK is precisely what I don't know how to do.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 24th December 2014 - 04:10 PM