pls help............
hello frnds i ma mukul
i am working on a java project in netbeans
i am using swing application
there is a use of JTabbedPane
for which i have to give the object of other class as a Parameter
but when i create another class outside the previous class it shows error that cannot find symbol;
the code below will will explain more
package ssca;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;
/**
*
* @author mukul
*/
public class Main extends JFrame{
JTabbedPane tab1,tab2,tab3,tab4;
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Main obj=new Main();
obj.run();
}
void run()
{
Cities obj2=new Cities();
tab1=new javax.swing.JTabbedPane();
tab1.addTab("cities",new CitiesPanel());
tab1.addTab("color",new ColorPanel());
tab1.addTab("flavor",new FlavorPanel());
tab1.addTab("taste",new TastePanel());
tab1.addTab("country",new CountriesPanel());//here is the error rest is working fine
tab1.addTab("tast",obj2);
getContentPane().add(tab1);
setSize(600,600);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setVisible(true);
}
}
class CitiesPanel extends JPanel
{
public CitiesPanel()
{
JButton btn=new JButton("Cities");
add(btn);
JTextField txt=new JTextField();
add(txt);
String s=txt.getText();
btn.setText(s);
add(btn);
}
}
class ColorPanel extends JPanel
{
public ColorPanel()
{
JButton btn=new JButton("Color");
add(btn);
}
}
class FlavorPanel extends JPanel
{
public FlavorPanel()
{
JButton btn=new JButton("Flavor");
add(btn);
}
}
class TastePanel extends JPanel
{
public TastePanel()
{
JButton btn=new JButton("Taste");
add(btn);
}
}
now i have made another class CountriesPanel outside this class in same package...........
pls.help......