Java JOptionPane Help!

icklejez

Member
Jan 12, 2007
50
0
0
I'm trying to display a set of SQL query results from one class to my GUI in a pop up windows, im trying to use JOptionPane, is there a better way of doing it? heres what im going on so far that i want to display:

statement = link.createStatement();
results = statement.executeQuery(
"SELECT * FROM MyTable");

Thats within the method displayTableContents() which is within class myResults.

My gui does this:

public void actionPerformed(ActionEvent e)
{
System.out.println(e.getActionCommand());


if (e.getActionCommand().equals("View Full List"))
{
new myResults().displayTableContents();
JOptionPane.displayTableContents(results = statement.executeQuery(
"SELECT * FROM myTable"), "Full List");
}
}

But it cant be resolved, is there an easier way to have my GUI pop up with the output from my MS access database?