package gwatoolbox;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BoxLayout.*;
import javax.swing.JButton.*;
import javax.swing.JCheckBox.*;
import javax.swing.JFrame.*;
import javax.swing.JPanel.*;
import javax.swing.JTabbedPane.*;
import javax.swing.*;
/*
* @author Tyler
*/
public class GWAToolbox extends JFrame
{
public void GWAToolbox()
{
// Puts the application name at the top of the window.
setTitle("GWA Toolbox");
setSize(300,300);
// Creates a tabbed window.
JTabbedPane jtp = new JTabbedPane();
getContentPane().add(jtp);
JPanel jp1 = new JPanel();
JPanel jp2 = new JPanel();
JPanel jp3 = new JPanel();
JCheckBox checkbox1 = new JCheckBox();
checkbox1.setText("Clear Temporary Internet Files");
jp2.add(checkbox1);
JCheckBox checkbox2 = new JCheckBox();
checkbox2.setText("Clear Browser History");
jp2.add(checkbox2);
JCheckBox checkbox3 = new JCheckBox();
checkbox3.setText("Clear Browser Cookies");
jp2.add(checkbox3);
JButton button1 = new JButton();
button1.setText("Shred!");
jp2.add(button1);
jtp.addTab("Home", jp1);
jtp.addTab("Privacy Tune Up", jp2);
jtp.addTab("Utility Tests", jp3);
}
public static void main(String[] args)
{
GWAToolbox gwa = new GWAToolbox();
gwa.GWAToolbox();
gwa.setSize(800, 400);
gwa.setVisible(true);
}
}
And here is the class that I am trying to call it from:
package gwatoolbox;
import javax.swing.JCheckBox.*;
import javax.swing.JFrame.*;
import javax.swing.JPanel.*;
import javax.swing.JTabbedPane.*;
import javax.swing.*;
/*
* @author Tyler
*/
public class CheckOS
{
public void CheckOS()
{
// Gather GUI information from GWAToolbox.java
GWAToolbox toolbox = new GWAToolbox();
toolbox.GWAToolbox();
// Determine which operating system the user is running.
JLabel label1 = new JLabel();
String OSname = System.getProperty("os.name");
if (OSname.startsWith("Windows"))
{
label1.setText("You are a commoner, because you are running Windows.");
//jp1.add(label1);
}
else if (OSname.equals("Mac OS X"))
{
label1.setText("You must have a lot of money, because you have Mac.");
//jp1.add(label1);
}
else if (OSname.equals("Linux"))
{
label1.setText("You must be thrifty, because you are running Linux, which is free.");
//jp1.add(label1);
}
}
}
I'm getting a Symbol Not Found error under jp1 in the 2nd class so I know that it has something to do with the way I'm calling my main class since I created the JPanel in the main class. Any help will be greatly appreciated.

New Topic/Question
Reply




MultiQuote





|