• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Java JOptionPane Help!

icklejez

Member
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?
 
Back
Top