Results 1 to 11 of 11
  1. #1
    Lyricid is offline Member
    Join Date
    Nov 2009
    Posts
    28
    Rep Power
    0

    Exclamation How Do You?? Get the Console Output as a GUI??

    How Do You??

    Get the Console Output as a GUI??

    i do not know entirely if this can be done but i have trolled google, textbooks, to try and get this to work, basically i have a code in BlueJ which is a InsertionSort code, it randomly picks numbers for array and sorts then with the InsertionSort method, it has 4 classes which are all linked together.

    The output console is where the user can enter their parameters, to define the size and range of the array.

    [Heres what i get on my output console]

    Enter the AMOUNT of integers for the array:

    10 <---- Number inputted by user
    Enter the RANGE of integers for the array:

    10 <---- Number inputted by user

    9 5 3 6 7 7 3 7 5 1
    1 3 3 5 5 6 7 7 7 9

    InsertionSort Algorithm running time (ns): 4000ns
    InsertionSort Algorithm running time (ms): 0ms


    i would like to know if there is any way that this console output can be made into a GUI? if so i need help many thanks in advance!

    Sachin

  2. #2
    aaroncarpet's Avatar
    aaroncarpet is offline Senior Member
    Join Date
    Nov 2009
    Location
    California
    Posts
    147
    Rep Power
    0

    Default

    you can doit quickly by using JOptionPane ....or JDialogue check the api

    Java Platform SE 6

    let me know if you don't know how to read the api

  3. #3
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Quote Originally Posted by aaroncarpet View Post
    It took about an hour but use this code as your base
    ..
    Please stop using fire crackers to format your code.

  4. #4
    aaroncarpet's Avatar
    aaroncarpet is offline Senior Member
    Join Date
    Nov 2009
    Location
    California
    Posts
    147
    Rep Power
    0

    Default

    i cleaned it up sorry

  5. #5
    Lyricid is offline Member
    Join Date
    Nov 2009
    Posts
    28
    Rep Power
    0

    Default

    omg thanks so much....but

    9 5 3 6 7 7 3 7 5 1" + '\n' +"1 3 3 5 5 6 7 7 7 9

    this is not my actual array, my array is randomly generated after the user inputs the Length (by integer) of the Array and Range (by integer) of the Array

    any ideas :(

    i appreciate your help so much

  6. #6
    Lyricid is offline Member
    Join Date
    Nov 2009
    Posts
    28
    Rep Power
    0

    Exclamation

    i have attached my code as follow i am currently using NetBeans

    if you run the InsertionSort Class you get the console output telling you to enter amount, then enter range, this then shows the unsorted array then sorted array, and the the time take in ns and ms

    I want to create a interface that allows the user to enter the two inputs and then the interface to show the unsorted array and then sorted array and the times taken

    Any ideas?? its been baffling me for a few days
    Attached Files Attached Files

  7. #7
    aaroncarpet's Avatar
    aaroncarpet is offline Senior Member
    Join Date
    Nov 2009
    Location
    California
    Posts
    147
    Rep Power
    0

    Default

    Quote Originally Posted by Lyricid View Post
    omg thanks so much....but

    9 5 3 6 7 7 3 7 5 1" + '\n' +"1 3 3 5 5 6 7 7 7 9

    this is not my actual array, my array is randomly generated after the user inputs the Length (by integer) of the Array and Range (by integer) of the Array

    any ideas :(

    i appreciate your help so much
    I am not going to do everything for you that is why ihave the comment that where you see that string of mine is where you are supposed to implement your algorithm i am not going to program your algorithm for you
    and so you will have to figure out how to use my get_data() twice and save 2 seperate numbers and put them into your algorithm. otherwise the rest of the program is there and it runs copy and compile.
    Last edited by aaroncarpet; 11-18-2009 at 05:32 PM.

  8. #8
    aaroncarpet's Avatar
    aaroncarpet is offline Senior Member
    Join Date
    Nov 2009
    Location
    California
    Posts
    147
    Rep Power
    0

    Default

    I am bringing into netbeans now and giving a look how did you attatch the file ??

  9. #9
    aaroncarpet's Avatar
    aaroncarpet is offline Senior Member
    Join Date
    Nov 2009
    Location
    California
    Posts
    147
    Rep Power
    0

    Default new insertion sort

    I redid the netbeans now its gui heres your project. after unzipped this needs to be moved into your nebeans projects folder
    Attached Files Attached Files
    Last edited by aaroncarpet; 11-20-2009 at 11:36 PM. Reason: clarifications

  10. #10
    Lyricid is offline Member
    Join Date
    Nov 2009
    Posts
    28
    Rep Power
    0

    Default

    you are a legend!

    You are a don!

    thank you so much!!!

  11. #11
    aaroncarpet's Avatar
    aaroncarpet is offline Senior Member
    Join Date
    Nov 2009
    Location
    California
    Posts
    147
    Rep Power
    0

    Default

    you need to come to this thread and at the top of the page under thread tools mark this thread as solved

Similar Threads

  1. How to align the output on console?
    By sfe23 in forum New To Java
    Replies: 5
    Last Post: 03-30-2009, 03:28 AM
  2. Java, output string, getting correct output? HELP!
    By computerboyo in forum New To Java
    Replies: 2
    Last Post: 02-25-2009, 11:44 PM
  3. Java Swing class capturing output to the console
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-12-2008, 11:24 AM
  4. Console doesn't appear!
    By PeteMarsh in forum New To Java
    Replies: 2
    Last Post: 12-17-2007, 05:41 PM
  5. Replies: 1
    Last Post: 07-24-2007, 02:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •