Hello, I am making a program for class, and it is a Swing GUI based program and you input a few different things and it puts it into a JTable. One value it puts in the table is a ratio that is calculated from two numbers the user inputs. I need to be able to sort the table by descending ratio values.
Any help would be appreciated,
Thanks
JMenu
Website won't let me attach the .zip of the java file, so here's a link to it PeelPetHouse.javaCode:// Display All Animals Menu Method
public void displayall ()
{
contentPane = getContentPane ();
if (infoPane != null)
contentPane.remove (infoPane);
infoPane = new JPanel ();
infoPane.setLayout (new BorderLayout ());
L1 = new JLabel ("Peel Pet House Animals:", JLabel.CENTER);
L1.setFont (new Font ("Arial", Font.BOLD, 24));
infoPane.add (L1, BorderLayout.NORTH);
L2 = new JLabel ("End of Page", JLabel.CENTER);
infoPane.add (L2, BorderLayout.SOUTH);
String [] columnNames = {"Breed", "Category", "Acquisition Price", "Selling Price", "Profit Ratio"};
table = new JTable (animalData, columnNames);
JScrollPane scrollPane = new JScrollPane(table);
infoPane.add (scrollPane, BorderLayout.CENTER);
contentPane.add (infoPane);
validate ();
}

