Console window in Swing GUI

Hi,
Im desinging an IDE using Swing components. In the IDE, I need to have a text editor pane and two console windows.
I have designed the text pane using Swing components - now including the console window within in the Jpanel is posing a big challenge.
Can you tell me how to split the panel - so that I will have text editor and console window side by side?
I believe to accomplish this - console widnow should run in Java programs' address space. Is this possible?
I have a image file which tells exactly what I have in mind - Im not able to attach it due to space limitations.
Send me a email and I shall send you the image file.
TIA.
Regards,
-Balaji

I believe a true Console is ran in system space and not in Java's address space. You'll not be able to manipulate it.

Similar Messages

  • Closing Console window while running Java application from Batch file

    Hi all,
    I have made a small application using Java swings,now i have made a jar file of my application and calling this jar file through batch file,when user clicks on that batch file it runs "java -jar applicationname.jar" command,but problem is that when i run that file from batch file it opens Dos console window at baclk of the screen which looks weird for a desktop application,i dnt want that Dos console window visible at the backend while my application is running,i have searched regarding this on google but found nothing usefull,if anybody can please help regarding that it will be a great releif for me,i have been stuck on this problem from last two days.
    Thanks.
    Simer

    warnerja wrote:
    georgemc wrote:
    warnerja wrote:
    start java -jar applicationname.jar
    That'll pop up another consoleI'm under the impression that the console window he is seeing is the one which cmd.exe opens when it is executing the batch file. And that batch file won't return until the java process has completed because he didn't start it in the background to let the batch file continue and terminate.
    So I don't think just simply substituting java with javaw will do much good either. Still think he needs a "start" command in that batch file.
    So now he can try:
    start java -jar ...
    or
    start javaw -jar ...Fair point

  • In this case, can I modify swing GUI out of swing thread?

    I know the Swing single thread rule and design (Swing is not thread safe).
    For time-consuming task, we are using other thread to do the task and
    we use SwingUtilities.invokeAndWait() or SwingUtilities.invokeLater (or SwingWorker) to update Swing GUI.
    My problem is, my time-consuming task is related to Swing GUI stuff
    (like set expanded state of a huge tree, walk through entire tree... etc), not the classic DB task.
    So my time-consuming Swing task must executed on Swing thread, but it will block the GUI responsivity.
    I solve this problem by show up a modal waiting dialog to ask user to wait and
    also allow user to cancel the task.
    Then I create an other thread (no event-dispatch thread) to do my Swing time-consuming tasks.
    Since the modal dialog (do nothing just allow user to cancel) is a thread spawn by
    Swing event-dispatch thread and block the Swing dispatch-thread until dialog close.
    So my thread can modify Swing GUI stuff safely since there are no any concurrent access problem.
    In this case, I broke the Swing's suggestion, modify Swing stuff out of Swing event-dispatch thread.
    But as I said, there are no concurrent access, so I am safe.
    Am I right? Are you agree? Do you have other better idea?
    Thanks for your help.

    If you drag your modal dialog around in front of the background UI, then there is concurrent access: paint requests in your main window as the foreground window moves around.

  • Console window and debugging in  ME platform SDK 3.0

    Hi All!
    I've just started to use new ME platform SDK 3.0. I've imported my WTK 2.5 project and faced unexpected problems.
    1) Cannot find debug console window ( where System.out.println() output goes to).
    2) Cannot Run Main project in debug mode, although I can run it using Run Main project (F6) and it works fine.
    Could anybody point me the solution?
    Thanks in advance.

    Hi,
    output console is in Window -> Output or Ctrl+4 shortcut
    Run in debug mode is a little bit confusing in jmesdk 3.0. It just starts an emulator in debug mode. Basically it does the same like commandline emulator.exe -Xdescriptor:<path to jad> -Xdebug -Xrunjdwp:transport=dt_socket,address=<port>,server=y,suspend=n.
    Jmesdk 3.0 doesn't contain debugger console and is expected that user will connect to emulator runnning in debug mode using his preferred gui debugger (netbeans, eclipse etc.)

  • How to get this boring console window closed???

    Hello Everybody!
    I have a little problem!
    The Java-Swing classes are very nice and I wrote some applications with them, but one thing is very annoying:
    Every application starts this boring console window!!!
    And now my question:
    HOW can I close the console (maybe within my sourcecode) so that only my Frames (JFrames) will stay open???
    Because it's surely important: I am running Windows 2000!
    So, thanks A LOT!!!!
    Black Widow

    Thanks!
    THAT was the mistake!
    But unfortunaley I didn't know that command, till now!
    Thanks again!
    BlackWidow

  • 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();
              

  • 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.

  • 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.

  • Console window is not showing up

    The console window for Java programs is not visible. Swing windows still working fine, and the program is still running (according to the Task Manager)
    I use windows XP.
    And yes, I've already tried going into Control Panel -> Java -> Advanced -> Show Console.
    Edited by: KaoroSorane on Jan 4, 2010 8:09 AM

    KaoroSorane wrote:
    The standard console, I guess...
    System.out.
    Well, think of this test:
    public class A {
         public static void main (String[] args) {
              while (true){
                   System.out.println("Hey");
                   try { Thread.sleep(1000); }
                   catch ( InterruptedException e ) {break;}
    }If I run it from Eclipse, it's console box on the bottom will show the output, but if I export it as a runnable jar, it won't show up.See the previous reply about the difference between javaw.exe and java.exe
    >
    Also, if I try to run it from DOS command:
    java HelloWorld.jar
    It throws:
    Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld/jar
    Caused by: java.lang.ClassNotFoundException: HelloWorld.jar
              blablabla
              blablabla
    Could not find the main class: HelloWorld.jar. Program will exit.I'm guessing the error is in Eclipse?Try
    java -jar HelloWorld.jar

  • About the Swing GUI view

    hello
    i am developing an application with swing but i don't like the Swing skin. I want XP style or windows classic style GUI. is that possible ? For example:font style of my menus are bold and different from windows classic fonts.

    public static void setSystemLookAndFeel()
          try{
             UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
          }catch(Exception e){}
       }there is a method to make it the systems style of.

  • 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.

  • Input a string and assign to a variable in the console window

    i'm absolutely and completely new to java
    i need to be able to input a string and then assign it to a variable, entirely using the console window, basically i'm looking for the Java alternative to C++'s "cin"
    i've tried the System.in. method but nothing seems to work
    i know this should be simple, but i cant find it anywhere
    cheers

    i've tried the System.in. method That thing is not a method: it's an object, an intstantiation of the InputStream
    class. If you read the API documentation for that class you'll notice that it
    isn't much more sophisticated than C's file IO. You can wrap an
    object if this class in a more high level class (see InputStreamReader
    and BufferedReader).
    The latter allows you to read an entire line of characters. If you really want
    to go fancy you can wrap the first class in a Scanner which is only
    available in Java 1.5
    kind regards,
    Jos

  • 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();
    //}

  • Console window doesn't show on second start of java.exe

    I am building restart capability into my product.
    When the product is started for the first time, it is started through a Windows EXE using a ShellExecuteEx method. I simply launch "java.exe" with my classpath, etc. My Windows console window shows up and I am happy.
    When a do a restart of the app, I am inside of the original JVM. I have access to the exact same commandline that I used in the EXE to launch "java.exe" originally.
    With the restart, I simply call Runtime.getRuntime().exec(commandline) and pass in the exact same commandline that I passed in when I did this in the EXE. However, when I do this from within the JVM, I do not get my Windows console window. This is not good.
    Does anybody understandn what is going on here and how I can remedy this?
    Thanks in advance for your help!

    I'm not sure what is happening in your case.
    Do the images initially show in "Tools > Page Info > Media" or is that always with size 0px?
    Quote: ''but if i click on same link second time than size gets right and image is shown under preview box.''
    Is that with clicking on the web page?
    Can you load the images via the links that you see in "Tools > Page Info > Media" without any problems?
    Do you see the request for those images in the Network tab in the Web Console (Firefox/Tools > Web Developer) and what is the server response in that case?
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • JRE 1.4.2 Plugin - Error in console window

    I have just installed the latest JDK 1.4.2. When I run any of our applets I get the error below in the console window.
    Can't find bundle for base name sun.awt.windows.awtLocalization,
    locale en_GB
    I have tried this on other machines and get the same error.
    It didn't have this problem with the previous installation that we used 1.4.1_04.
    Has anybody got any idea what's causing it and how to fix it ?
    Thanks

    I have the exact same problem, and when i try to use the back space button in a text field in the applet, it either shows as Question marks or as rectangles...
    This is not an issue with MS VM...
    db

Maybe you are looking for