can anyone convert this code to GUI?? I really don't know where to put the GUI codes in it.. :(
please help.. :(
import java.util.Scanner;
//main class
public class Main
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
System.out.print("Enter the size of the array: ");
int n = input.nextInt();
int[] x = new int[n];
System.out.print("Enter "+ n +" numbers: ");
for(int i=0; i<n; i++)
{
x[i] = input.nextInt();
}
SelectionSort access = new SelectionSort();
System.out.print("The Sorted numbers: ");
access.SelectionSort(x);
}
}
//selectionSort class
public class SelectionSort
{
public void SelectionSort(int[] arr){
for(int i=0; i<arr.length; i++)
{
for(int j=i+1; j<arr.length; j++)
{
if(arr[i] > arr[j] )
{
int temp = arr[j];
arr[j] = arr[i];
arr[i] = temp;
}
}
}
for(int i=0; i<arr.length; i++)
{
System.out.print(arr[i] + " ");
}
}
}