Accessing non-static public variables from another class
I'm sorry if this is a completely ridiculous question but this is the New To Java forum so here it goes.
I have instantiated public variables in my Main class
I have three classes: Dashboard_Main, Dashboard_GUI and DB_Connection
public class Dashboard_Main
public ResultSet rs;
public DB_Connection connection;
I can't figure out how to access these variables from my Dashboard_GUI class. I have a method to execute a sql command and then it will add the contents to a table in my GUI
I get the error cannot find symbol: variable rs, same for connection
public class Dashboard_GUI extends JFrame
private void setTableInfo(Object cbContents)
rs = connection.createQuery("SELECT * FROM dashboard_data.families_products WHERE depot='"
+ strDepotSelected + "'");