Running Swing GUI in MAC OS ?

Hi All,
I have been trying to run swing based GUI on MAC Operating System. I downloaded MRJ but i could not found any swing support in it. I kept swingall.jar in classpath which i took from Window's JDK. But no use.
Can anybody help me out to run a simple GUI on MAC ?
Hopeing for a favourable response.
Kind Regards
Chetan Chandarana

If anyone wants to know where to get the swingall.jar for 1.1 go to: http://java.sun.com/products/jfc/download.archive.html#1.1.1
get the tar or zip file. Then put the swingall where impatient1 says to and swing will work.
You can also get lots of information on setting up Mac Classic for Java from:
http://lists.apple.com/mailman/listinfo/java-dev
on apple's web site. You can search the archives with a username and password listed on that page.
I could not find any information on the collections zip that impatient1 mentions in the post. If anyone knows where you can get that and if it really works, I would really like to know. :)

Similar Messages

  • Launch swing GUI on MAC

    I developed a swing GUI recently. It works perfectly under Linux, Unix, Windows, but the users of the GUI will run it on MAC. I haven't any idea about MAC. Does anybody give me some suggestions about
    How to launch my application on mac?
    Are there any strategies or tricks for running a swing GUI on MAC?
    How can I put a shortcut or icon on user's desktop of mac so that when the user click it, my swing gui can open immediately?
    Thank a million in advance

    Well... on Mac OS X, it is very easy. You just put your application in a .jar file. On Mac OS X, jar files are automatically run when double clicked. You won't have to worry about downloading a jdk, because it is integrated with the system.
    Mac OS 9 however only made it to jdk version 1.1.8, and you will have to use the Bindary program to make it runnable. Strongly suggest users to upgrade to Mac OS X, because on 9, it is a pain...
    With pleasure,
    Wannes.

  • Need to run swing GUIs under different JRE versions

    I need to run swing GUIs under different JRE versions. Where can I find information about how to use only classes which exist from version 1.1.7 and above?

    Under 1.1.7, Swing (then version 1.0) was under com.sun.java.swing. The package name changed in Swing 1.1 b3/JDK 1.2 to javax.swing. You can see what classes were available under Swing 1.0 at http://java.sun.com/products/jfc/swingdoc-api-1.0.3/frame.html

  • Running Swing programs on Mac system

    Hi,
    I am using j2sdk1.4 version (jre 1.4) on windows system and developed application using swing.
    I wanted to test this applicaion on Max 8.1 later.
    will this work or I need to install different version of j2sdk on windows (which is supprted by mac ) and run the application?
    Thanks,
    padmashree

    mac os just supports JRE 1.3. at version 10.

  • Running a Java application from a Swing GUI

    Hi,
    I was wondering if there is a simple way to run a Java application from a GUI built with Swing. I would presume there would be, because the Swing GUI is a Java application itself, technically.
    So, I want a user to click a button on my GUI, and then have another Java application, which is in the same package with the same classpaths and stuff, run.
    Is there a simple way to do this? Do any tutorials exist on this? If someone could give me any advice, or even a simple "yes this is possible, and it is simple" or "this is possible, but difficult" or "no this is not possible" answer, I would appreciate it. If anyone needs more information, I'll be happy to provide it.
    Thanks,
    Dan

    I don't know if it is possible to run the main method from another Java app by simply calling it...
    But you could just copy and paste the stuff from your main method into a new static method called something like runDBQuery and have all the execution run from there.
    How does that sound? Is it possible?
    What I'm suggeting is:
    Original
    public class DBQuery{
    public static void methodA(){
    public static void doQuery(){
    methodA();
    public static void main(String[] args){
    // Your method calls
    //Your initializing
    doQuery();
    }Revised:
    public class DBQuery{
    public static void methodA(){
    public static void doQuery(){
    methodA();
    public static void doMyQuery(){
    // Your method calls
    //Your initializing
    doQuery();
    // No main needed!!
    //public static void main(String[] args){
    // Your method calls
    //doQuery();
    //}

  • UI problem when run java swing application on MAC OSX

    Hello,
    I have problem when i run my java swing application on MAC OSX.
    Dialog box is not properly visible in MAC means ita size increses.
    its size incresed and and some content or buttons on that dialog are not fully visible.
    I can only see partial message or button.
    If any one have idea about this problem then give the solution.
    Thanks :)
    Shweta

    I am using following way to create dialog
    JOptionPane optionpane = new JOptionPane(new Object[]{lblMsgUp}, JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE, null, choices, "Save");
    JDialog dialog = optionpane.createDialog(parent, "Save");
    dialog.setSize(450, 125);
    dialog.setVisible(true);

  • How to run Java Swing GUI on embedded ARM Linux platform?

    The object is:
    A touch panel, running Java Swing GUI, with a 25 fps 320x320 mono JPEG image animation and other control buttons.
    What I have now:
    A Developing Board with: ARM926 CPU at 266MHz, 128M RAM, 64M ROM, ported with arm-linux and MiniGUI.
    My plan is:
    1. installing a X-window system to the platform, discarding the MiniGUI.
    2. install j2re-1.3.1-RC1-linux-arm.tar.bz2 to the platform.
    3. run my program developed on a PC.
    My concerns are:
    1. Both X and Java is resource consuming, can a 266MHz ARM CPU meet my requirement?
    2. Is the X a must to run Java Swing GUI? If yes, how can I configure it to minimize the footprint, I mean, install only necessary modules.
    3. Can J2RE 1.3.1, the only port for arm linux, support Swing classes?
    4. Are there other options, such as CDC + PP(AGUI?), how to do it?
    Thanks alot!

    3. Can J2RE 1.3.1, the only port for arm linux, support Swing classes?I'm not entirely sure from your post: is this a J2SE port? If so it will support Swing, but probably needs Qt.

  • SAP GUI for Mac OS X 10.4

    I want to upgrade my Macs to Apples current operating system Mac OS X 10.4.1 Tiger. I had read few weeks ago, the JAVA-Implementation doesn't work with any SAP GUI for Java. SAP has recommended, to still work with Mac OS X 10.3.9 and SAP GUI for Java 6.30 Revision 8.
    When will be available a working SAP GUI for Mac OS X 10.4.1 Tiger ? Has someone informations ?

    Hello all,
    I completely understand the impact of the missing Mac support. I try to explain the reason for the current situation and give an outlook.
    Starting in summer 2004, the SAPGUI development team and test labs have dedicated a significant amount of time in testing on Mac OS X 10.4 preview versions, reporting bugs and pushing Apple to fix them. We opened more than 20 bug reports, which were not exclusively related to SAP GUI, just plain JFC/Swing issues. Unfortunately two show-stoppers for SAP GUI were left at the time Apple shipped Mac OS X 10.4.
    Since April this year we are running more tests on developer preview versions of the Java 1.4.2 Release 2, which is supposed to address these issues.
    With developer preview 3, there are no severe open issues left and we are just waiting for Apple to ship the final version of JRE 1.4.2 Release 2.
    Apple has not disclosed any shipment schedules in the past and so we have not been able to plan for something. If we would have known in advance, that the final version will be that long after developer preview 3, we would have started a beta seed based on a TEA (test and evaluation agreement) at the time developer preview 3 was available (beginning of August).
    Last week Apple has indicated that the final version of Java 1.4.2 Release 2 is expected to become available every day now. I hope Apple is right and this thread will be obsolete soon. SAP GUI for Java 6.40 rev 4 including the Mac OS X version is already waiting on the loading ramp.
    If there is no final version of Java 1.4.2 Release 2 by end of September we will provide an unsupported SAPGUI based on a test and evaluation agreement.
    Best regards
    Rolf-Martin

  • How can I run a gui app from an su shell?

    Hello,
    I login to my mac as a non-admin account.  I then open a terminal and su to my admin account for anything requiring it.  I am trying to run a gui app from the terminal window, but get this error, and the app does not open:
    $ /usr/local/bin/wireshark
    2011-08-14 06:54:29.327 defaults[18406:903]
    The domain/default pair of (kCFPreferencesAnyApplication, AppleAquaColorVariant) does not exist
    2011-08-14 06:54:29.346 defaults[18407:903]
    The domain/default pair of (kCFPreferencesAnyApplication, AppleHighlightColor) does not exist
    ./sync_osx_look.sh: line 40: gtkrc: Permission denied
    (process:18396): Gdk-WARNING **: locale not supported by C library
    (wireshark-bin:18396): Gtk-WARNING **: Locale not supported by C library.
              Using the fallback 'C' locale.
    (wireshark-bin:18396): Gtk-WARNING **: cannot open display:
    I know I can "switch user" but this is cumbersome as it requires typing a password each time, and I need to have applications side-by-side for easy access and testing.  Any thoughts?
    Thanks.

    I use LaunchAsRoot to run GUI apps as the root user, while logged in to my admin account.
    Another way is to use Applescript.  Here's what I do to run Console as root:
    do shell script "/Applications/Utilities/Console.app/Contents/MacOS/Console > /dev/null 2>&1 &" with administrator privileges

  • Loading large files in Java Swing GUI

    Hello Everyone!
    I am trying to load large files(more then 70 MB of xml text) in a Java Swing GUI. I tried several approaches,
    1)Byte based loading whith a loop similar to
    pane.setText("");
                 InputStream file_reader = new BufferedInputStream(new FileInputStream
                           (file));
                 int BUFFER_SIZE = 4096;
                 byte[] buffer = new byte[BUFFER_SIZE];
                 int bytesRead;
                 String line;
                 while ((bytesRead = file_reader.read(buffer, 0, BUFFER_SIZE)) != -1)
                      line = new String(buffer, 0, bytesRead);
                      pane.append(line);
                 }But this is gives me unacceptable response times for large files and runs out of Java Heap memory.
    2) I read in several places that I could load only small chunks of the file at a time and when the user scrolls upwards or downwards the next/previous chunk is loaded , to achieve this I am guessing extensive manipulation for the ScrollBar in the JScrollPane will be needed or adding an external JScrollBar perhaps? Can anyone provide sample code for that approach? (Putting in mind that I am writting code for an editor so I will be needing to interact via clicks and mouse wheel roatation and keyboard buttons and so on...)
    If anyone can help me, post sample code or point me to useful links that deal with this issue or with writting code for editors in general I would be very grateful.
    Thank you in advance.

    Hi,
    I'm replying to your question from another thread.
    To handle large files I used the new IO libary. I'm trying to remember off the top of my head but the classes involved were the RandomAccessFile, FileChannel and MappedByteBuffer. The MappedByteBuffer was the best way for me to read and write to the file.
    When opening the file I had to scan through the contents of the file using a swing worker thread and progress monitor. Whilst doing this I indexed the file into managable chunks. I also created a cache to further optimise file access.
    In all it worked really well and I was suprised by the performance of the new IO libraries. I remember loading 1GB files and whilst having to wait a few seconds to perform the indexing you wouldn't know that the data for the JList was being retrieved from a file whilst the application was running.
    Good Luck,
    Martin.

  • Swing issue in MAC

    I am facing peculiar issues in a Swing app on Mac OS X running JDK 1.4. The separators on the JMenus and grid lines in any JTable just don't show up on Mac. The same code works fine on Windows and Linux. Is there any thing different to be done for Mac?

    you can always change the look and feel code, I guess.
    maybe they're there but don't paint anything?

  • Error message when running a gui

    Hi,
    When i run my gui i get the following error message:
    09-Mar-2006 14:40:24 java.util.prefs.FileSystemPreferences checkLockFile0ErrorCode
    WARNING: Could not lock System prefs.Unix error code 1685182512.
    09-Mar-2006 14:40:24 java.util.prefs.FileSystemPreferences syncWorld
    WARNING: Couldn't flush system prefs: java.util.prefs.BackingStoreException: Couldn't get file lock.
    Can anybody help to explain why i would be getting this?
    Cheers

    Are there other instances of the application still
    running when you start the new one? Are there still
    some old processes running?i don't think so.
    would you mind having a look at my code?
    my code is:
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.io.*;
    import javax.swing.filechooser.*;
    public class RunPanel extends JPanel implements ActionListener
         JButton openButton, setParametersButton, saveButton;
         static private final String newline = "\n";
         double affinityThresholdScalar;
         double clonalRate;
         double hypermutationRate;
         double KNN;
         int seed;
         double stimulationValue;
         double totalResources;
         int NumberOfClass;
         int nFold;
         int setSize;
         int iterations = 0;
         double accuracy;
         int testSize;
         int correct = 0;
         int inCorrect = 0;
         int count = 0;
         boolean stopCondition = false;
         double reduction;
         int stimIndex;
         Vector AntigenTest;
         Float zero = new Float(0.0);
         JTextArea log;
             JFileChooser fc;
         Data d = new Data();
         Normalise rf = new Normalise();
         Affinity af = new Affinity();
         Initialise i = new Initialise();
         Stimulation s = new Stimulation();
         Training t = new Training();
         CompetitionForLtdRes c = new CompetitionForLtdRes();
         MemoryCellSelection MS = new MemoryCellSelection();
         Classification C = new Classification();
         PureCopy p = new PureCopy();
         Parameters param = new Parameters();
         RandomSort r = new RandomSort();
        public RunPanel()
            super(new BorderLayout());
            log = new JTextArea(5,20);
            log.setMargin(new Insets(5,5,5,5));
            log.setEditable(false);
            JScrollPane logScrollPane = new JScrollPane(log);
            //Create a file chooser
            fc = new JFileChooser();
            openButton = new JButton("Open a File...");
            openButton.addActionListener(this);
         setParametersButton = new JButton("Set User Parameters");
            setParametersButton.addActionListener(this);
         saveButton = new JButton("save");
            saveButton.addActionListener(this);
            JPanel buttonPanel = new JPanel(); //use FlowLayout
            buttonPanel.add(openButton);
         buttonPanel.add(setParametersButton);
         JPanel savePanel = new JPanel();
         savePanel.add(saveButton);
            //Add the buttons and the log to this panel.
            add(buttonPanel, BorderLayout.PAGE_START);
            add(logScrollPane, BorderLayout.CENTER);
         add(savePanel, BorderLayout.SOUTH);
        public void actionPerformed(ActionEvent e) {
            //Handle open button action.
            if (e.getSource() == openButton) {
                int returnVal = fc.showOpenDialog(RunPanel.this);
         if (returnVal == JFileChooser.APPROVE_OPTION) {
                    File file = fc.getSelectedFile();
              affinityThresholdScalar = param.getAffinityThresholdScalar();
              log.append("Affinity Threshold scalaR:  " +affinityThresholdScalar+ "." + newline);
              clonalRate = param.getClonalRate();
              log.append("Affinity Threshold scalaR:  " +clonalRate+ "." + newline);
              hypermutationRate = param.getHypermutationRate();
              log.append("Affinity Threshold scalaR:  " +hypermutationRate+ "." + newline);
              KNN = param.getKNN();
              log.append("Affinity Threshold scalaR:  " +KNN+ "." + newline);
              seed = param.getSeed();
              log.append("Affinity Threshold scalaR:  " +seed+ "." + newline);
              stimulationValue = param.getStimulationValue();
              log.append("Affinity Threshold scalaR:  " +stimulationValue+ "." + newline);
              totalResources = param.getTotalResources();
              log.append("Affinity Threshold scalaR:  " +totalResources+ "." + newline);
              NumberOfClass = param.getClas();
              log.append("Affinity Threshold scalaR:  " +NumberOfClass+ "." + newline);
              nFold = param.getNFold();
              log.append("Affinity Threshold scalaR:  " +nFold+ "." + newline);
              /*Processing takes place here*/
                    Vector data = d.readFile(file);
              log.append("Reading file into Vector." + newline);
              Vector dataNormalised = rf.normalise(data);
              log.append("Normalising Data." + newline);
              Vector DataReady = r.Sort(dataNormalised);
              log.append("Randomly sorting data." + newline);
              setSize = Math.round(DataReady.size()/nFold);
              for(int j=0; j< DataReady.size()-setSize; j+=setSize)
                   Vector affinity = new Vector();
                   Vector trainingData = new Vector();
                   Vector training = new Vector();
                   Vector test = new Vector();
                   Vector testData = new Vector();
                   Vector trainingData1 = new Vector();
                   Vector DataNormalised = new Vector();
                   Vector newV = new Vector();
                   Vector ARB = new Vector();
                   Vector BestMatch = new Vector();
                   Vector BestMatch1 = new Vector();
                   Vector testDataNormalised = new Vector();
                   Vector MemoryPool = new Vector();
                   Float maxDist = new Float(0.0);
                   Float affinityThreshold = new Float(0.0);
                   MemoryPool.removeAllElements();
                   log.append("memoryPool sie at the beginning of itteration" +MemoryPool.size()+ "." + newline);
                   ARB.removeAllElements();
                   int end = j+setSize;
                   //System.out.println("data ready" +DataReady);
                   log.append("data ready size" +DataReady.size()+ "." + newline);
                   if(end <= DataReady.size())
                        testData =new Vector(DataReady.subList(j, end));
                        if(j == 0)
                             trainingData = new Vector(DataReady.subList(end, DataReady.size()));
                        else
                             trainingData = new Vector(DataReady.subList(0, j));
                             trainingData1 = new Vector(DataReady.subList(end, DataReady.size()));
                             for (int b= 0; b < trainingData1.size(); b++)
                                  newV = (Vector)trainingData1.elementAt(b);
                                  trainingData.add(newV);
                   else
                        //do nothing
                   training = p.createPureCopy(trainingData);
                   test = p.createPureCopy(testData);
                   log.append("testDataSize" +test.size()+ "." + newline);
                   log.append("trainingDataSize" +training.size()+ "." + newline);
                   affinity = af.calcAffinity(training);
                   log.append("affinity size" +affinity.size()+ "." + newline);
                   MemoryPool = i.seedMemoryPool(training, seed);
                   affinityThreshold = i.affinityThreshold(affinity);
                   log.append("affinity Threshold" +affinityThreshold+"." + newline);
                   iterations ++;
                   //System.out.println("iterations" +iterations);
                   int count2 = 0;
                   for(int k=0;k<training.size();k++)
                        Vector Antigen1 = new Vector();
                        Vector Antigen = new Vector();
                        Antigen1 = (Vector)training.elementAt(k);
                        Antigen = (Vector)Antigen1.clone();
                        Float memPoolStimulation = new Float(0.0);
                        memPoolStimulation = s.calcMemPoolStimulation(MemoryPool, Antigen);
                        if(memPoolStimulation.floatValue() == zero.floatValue())
                             MemoryPool.add(Antigen);
                        else
                             stimIndex = s.getStimIndex();
                             BestMatch = t.bestMatch(MemoryPool,Antigen,stimIndex,memPoolStimulation);
                             MemoryPool.removeElement(BestMatch);
                             MemoryPool.add(BestMatch);
                             BestMatch1 = p.createPureCopy1(BestMatch);
                             ARB = t.ARBGeneration(BestMatch1,hypermutationRate,clonalRate);
                             Vector Candidate = c.runARBRefinement(ARB, Antigen, stimulationValue,clonalRate, totalResources);
                             MemoryPool = MS.addCandidateCell(Candidate, MemoryPool, affinityThreshold, affinityThresholdScalar);
                             ARB.removeAllElements();
                             count2 ++;
                   log.append("count of training" +count2+ "." + newline);
                   log.append("ARB sie" +ARB.size()+ "." + newline);
                   log.append("memoryPool sie" +MemoryPool.size()+ "." + newline);
                   log.append("memoryPoole" +MemoryPool+ "." + newline);
                   testSize = test.size();
                   log.append("test size" +testSize+ "." + newline);
                   //log.append("testdata" +test+ "." + newline);
                   for(int a=0;a<testSize;a++)
                        AntigenTest = (Vector)test.elementAt(a);
                        log.append("Antigen test" +AntigenTest+ "." + newline);
                        Float AntigenClass = new Float(0.0);
                        AntigenClass = (Float)AntigenTest.lastElement();
                        Float classify = C.KNN(MemoryPool,AntigenTest,KNN,NumberOfClass);
                        log.append("classify" +classify+ "." + newline);
                        if(AntigenClass.floatValue() == classify.floatValue())
                             correct ++;
                        else
                             inCorrect ++;
                   accuracy = ((double)correct /testSize *100);
                   reduction = 100 - ((double)MemoryPool.size()/training.size()*100);
                   log.append("correct" +correct+"." + newline);
                   log.append("Incorrect" +inCorrect+"." + newline);
                   log.append("reduction" +reduction+"." + newline);
                   log.append("Accuracy" +accuracy+"." + newline);
                   count ++;
                   log.append("number of iterations " +count+"." + newline);
                   MemoryPool.removeAllElements();
             else {
                    log.append("Open command cancelled by user." + newline);
                log.setCaretPosition(log.getDocument().getLength());
         else if (e.getSource() == saveButton) {
                int returnVal = fc.showSaveDialog(RunPanel.this);
                if (returnVal == JFileChooser.APPROVE_OPTION) {
                    File file = fc.getSelectedFile();
                    //This is where a real application would save the file.
                    log.append("Saving: " + file.getName() + "." + newline);
                } else {
                    log.append("Save command cancelled by user." + newline);
                log.setCaretPosition(log.getDocument().getLength());
         else
              if (e.getSource() == setParametersButton)
                          param.show();
        /** Returns an ImageIcon, or null if the path was invalid. */
        protected static ImageIcon createImageIcon(String path) {
            java.net.URL imgURL = RunPanel.class.getResource(path);
            if (imgURL != null) {
                return new ImageIcon(imgURL);
            } else {
                System.err.println("Couldn't find file: " + path);
                return null;
         * Creates the GUI
        private static void createAndShowGUI() {
            JFrame.setDefaultLookAndFeelDecorated(true);
            JDialog.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
            JFrame frame = new JFrame("AIRS");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JComponent newContentPane = new RunPanel();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane);
            frame.pack();
         frame.setSize(400,400);
            frame.setVisible(true);
        public static void main(String[] args) {
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                 createAndShowGUI();
              JOptionPane.showMessageDialog( null, "please set the\nparameters\nbefore opening\n a file");
       }i know its a huge amount of code to look at. but any help at all will be much appreciated.
    Cheers

  • Need SAP GUI for Mac and process of how to install and configure

    Hi Experts,
         I need SAP GUI for Mac. Also please explain the process of how to install, how to configure etc? Please help me.

    You can download the SAP Presentation DVD that will have the SAPGUI Java version for OS X. After you install, just run the app from the Application Folder.
    For config there are a few options:
    1. To connect to a DI directly. After starting the app, click new and under the "Advanced" tab use the following string:
       conn=/H/(hostname)/S/(port / 3200 for instance ID 00)
    2. To connect to a login group. After starting the app, open the "Preferences" / Configuration / Messageservers, you need to set a path to a file that has the message servers in the following string
    (SID) :     /M/(hostname)/S/(message server port)
    Then click "New" and on the first tab you can choose a system and login group.
    Hope this helps.
    Thank
    matt

  • Running a GUI based software on powerbook G4

    Hi guys,
    I need to run a GUI based ERP software on my powerbook g4. the developer has no idea how to do so. he is not familiar with macs. but if he gets the right instructions he is ready to give it a try. Here's my query....is it possible to run this..and how so...what instructions do i give to the developer. Can you guys help to point out to certain literature which already addresses this issue. I need you help. thanks in advance.
    to the moderator...if this is posted on the wrong thread pls feel free to direct it to the right one.
    any help is appreciated.
    Powerbook G$   Mac OS X (10.4.8)  

    GUIs come in may different flavors. You need to find out more about what the developer is capable of/willing to do before you go to far. 
    If the developer has no Mac experience, it's unlikely that he'll rewrite his application as a fully-fledged Mac application since that's a non-trivial task.
    However, if the application uses a client-server model, he may be able to impement a graphical front-end without too much work. That front-end could be written in AppleScript (more likely AppleScript Studio), but he may prefer to write an app in a more traditional language such as C or C++.
    If the application is already running on other flavors of Unix, he may have an X11-based application, in which case his work is done - you can run X11 apps on the Mac without any additional programming work needed. It won't look like a traditional Mac application, but it will run (and be consistent with the other Unix systems it's running on).
    If he's familiar with Java he could write a Java-based front-end. This would probably be his best bet for all-round cross-platform portability.
    In any case, you might find the Developer or Software Development forums a more productive place to get started.

  • Swing GUI for Javadoc

    Hi everyone,
    I'm trying to learn some basic IO and Swing. My project is to make a Swing GUI for javadoc. It's supposed to run at least under W2K and XP.
    The Swing part is going fine, but I can't seem to get IO-part working.
    I tried working with the Runtime- and the Process-class, but I don't can't seem to execute javadoc or read any command-line output. Here's a sample of code that compiles ok, but doesn't do anything.
    try {
    Process p = Runtime.getRuntime().exec("javadoc");
    InputStream in = p.getInputStream();
    String s = in.toString();
    System.out.println(s);
    System.out.println();
    System.out.println(process.waitFor());
    System.out.println();
    System.out.println(process.exitValue());
    System.out.println();
    System.out.println(""+process);
    } catch (Exception e) {
    System.out.println("error");
    if anyone has any tips, suggestions or simple code samples, I would be very happy to hear from you.

    Alright, I figured out how to read the inputstream, but
    I still get an error:
    Windows 2000
    start
    <ERROR>
    javadoc: No packages or classes specified.
    and the program doesn't terminate for some reason.
    here's the new sourcecode:
    import java.io.*;
    public class JavaDocCommander {
         public static void main(String[] args) {
              System.out.println(System.getProperty("os.name"));
              System.out.println("start");
              new Test();
              System.out.println("slut");
    class Test{
         public Test(){
              try {           
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec("javadoc");
    InputStream stderr = proc.getErrorStream();
    InputStreamReader isr = new InputStreamReader(stderr);
    BufferedReader br = new BufferedReader(isr);
    String line = null;
    System.out.println("<ERROR>");
    while ( (line = br.readLine()) != null)
    System.out.println(line);
    System.out.println("</ERROR>");
    int exitVal = proc.waitFor();
    System.out.println("Process exitValue: " + exitVal);
    } catch (Throwable t)
    t.printStackTrace();
              

Maybe you are looking for

  • Calling all SharePoint 2010 users! May TechNet Gurus announced!

    The results for May's TechNet Guru competition have been posted! http://blogs.technet.com/b/wikininjas/archive/2014/01/16/technet-guru-awards-december-2013.aspx Congratulations to all our new Gurus for May! We will be interviewing some of the winners

  • HDMI does not come back after disconnect

    Hello Archers, this one is bugging me for a while now, perhaps someone has an idea. I have a headless ARCH home server that mainly has the following purposes: 1. being a 24/7 file/backup/ssh server for family and friends 2. being an MPD server connec

  • Unable to install BB DTM for Mac

    I'm running Mac OS 10.6.8 on a Mac Mini. I'm trying to install BlackBerry Desktop Software v2.1.0.24 (bundle 21). After i click the green icon for "install" in the window that opens when the downloaded install disk mounts, nothing happens. Having in

  • Printing Dark Background Converted PPT

    Hello, I have got a Power Point presentation in PDF format send by my professor, i have to print it out but it has got dark bakground and will use a lot of ink so to resolve i search out the method to change background and reached to the option of Ac

  • No Sound from iPod, Tried Everything

    Hi Guys, Any suggestions on what to do? About two weeks ago I would try to turn it on, got the green light, but no sound was coming out of it. (Trust me, it's not because I needed to turn the volume up I've tried just about everything that there is t