Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 1 of 1

Thread: Help in converting Java application to desktop application in Netbeans

  1. #1
    Junior Member
    Join Date
    Jun 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help in converting Java application to desktop application in Netbeans

    Hello,
    I hardly need a help in converting java application to desktop application , it's about connecting the java class to desktop components.
    The desktop interface and the java application are ready and just need to connect them.

    Here's the java application code


    import java.io.*;

    class process
    {
    String name;
    int burst;
    int priority;

    process(String x, int y, int z)
    {
    name=x;
    burst=y;
    priority=z;
    }
    }

    class use
    {

    public static void main(String args[])throws Exception
    {
    BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
    System.out.println("Enter no. of processes: ");
    int n=Integer.parseInt(br.readLine());
    process a[]=new process[n];

    for(int i=0;i<n;i++)
    {
    System.out.println("Enter name: ");
    String name=br.readLine();

    System.out.println("Enter burst time: ");
    int time=Integer.parseInt(br.readLine());

    System.out.println("Enter priority (greater is higher)");
    int pr=Integer.parseInt(br.readLine());

    a[i]=new process(name,time,pr);
    }

    for(int i=0;i<n-1;i++)
    {
    for(int j=0;j<n-1;j++)
    {
    if(a[j].priority<a[j+1].priority)
    {
    process temp=a[j];
    a[j]=a[j+1];
    a[j+1]=temp;
    }
    }
    }

    System.out.println("Gantt chart: ");

    for(int m=0;m<a.length;m++)
    {
    System.out.print(a[m].name+ " || ");
    }

    System.out.println();

    int wt=0;

    for(int i=0;i<a.length;i++)
    {
    wt+=(a.length-1-i)*a[i].burst;
    }

    System.out.println("Total waiting time: "+ wt);
    System.out.println("Avg waiting time: "+((float)wt/a.length));

    int bt=0;

    for(int j=0;j<a.length;j++)
    {
    bt+=a[j].burst;
    }

    System.out.println("Total turnaround time: "+(wt+bt));
    System.out.println("Average turnaround time: "+((wt+bt)/(float)a.length));
    }

    }
    the desktop application here
    http://realahmed8.googlepages.com/Priority.rar

    Thanks..
    Last edited by realahmed8; December 3rd, 2009 at 03:47 PM.


Similar Threads

  1. Java program to Add a JMenu toolbar to a Java Swing application
    By JavaPF in forum Java Swing Tutorials
    Replies: 6
    Last Post: March 6th, 2012, 11:25 AM
  2. Help with Java Application
    By Riston in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: November 19th, 2009, 06:17 PM
  3. SQLite and Desktop Application
    By urosz in forum JDBC & Databases
    Replies: 12
    Last Post: November 2nd, 2009, 02:50 AM
  4. java application connecting to a server
    By wildheart25c in forum Java Networking
    Replies: 2
    Last Post: September 17th, 2009, 07:22 AM
  5. Desktop Database Application
    By TCoomer in forum JDBC & Databases
    Replies: 2
    Last Post: June 4th, 2009, 03:51 PM