Results 1 to 4 of 4
- 12-03-2009, 10:29 PM #1
Member
- Join Date
- Jun 2008
- Posts
- 13
- Rep Power
- 0
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
the desktop application is attached..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));
}
}
Thanks..
-
You're going to need to try to learn Swing first before you will be able to accomplish this. I suggest you have a look at the Sun Swing tutorials for a good start: Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials)
Much luck!
- 12-04-2009, 11:22 AM #3
Member
- Join Date
- Jun 2008
- Posts
- 13
- Rep Power
- 0
Thanks for tutorial, But I have tried to connect files before submitting the help.. I still can't do it.
-
Then I'm afraid you have a lot more to learn. You can't learn Swing coding in a day. It's going to take a bit of time and effort. Realize please that no one is going to do your work for you.
Similar Threads
-
Converting java application to J2ME
By coldvoice05 in forum NetBeansReplies: 0Last Post: 10-10-2009, 04:32 PM -
run java application from desktop with double click
By Rose88 in forum Advanced JavaReplies: 4Last Post: 09-29-2009, 06:32 PM -
Converting an Application to an Applet in NetBeans
By RaefWolfe in forum NetBeansReplies: 1Last Post: 03-27-2009, 05:47 PM -
Problem running a java desktop application
By chris@gaiag.net in forum AWT / SwingReplies: 2Last Post: 08-24-2008, 04:24 AM -
Installer for Java desktop application
By nitingupta183 in forum SWT / JFaceReplies: 0Last Post: 03-18-2008, 07:53 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks