jarno
14-02-2009, 11:05
Ciao a tutti :)
io ho questa classe funzionante
package CreateTabbedPane;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class CreateTabbedPane{
private static String labelPrefix_1 = "1";
private static String labelPrefix_2 = "2";
private static String labelPrefix_3 = "3";
private static String labelPrefix_4 = "4";
private static String labelPrefix_5 = "4";
public static void main(String[] args){
JLabel label_1 = new JLabel(labelPrefix_1);
JLabel label_2 = new JLabel(labelPrefix_2);
JLabel label_3 = new JLabel(labelPrefix_3);
JLabel label_4 = new JLabel(labelPrefix_4);
JLabel label_5 = new JLabel(labelPrefix_5);
//JTextField testo_1 = new JTextField(scritta_1);
JFrame frame = new JFrame("Esempio");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JTabbedPane tab = new JTabbedPane();
frame.add(tab, BorderLayout.NORTH);
tab.add("1", label_1);
tab.add("2", label_2);
tab.add("3", label_3);
tab.add("4", label_4);
tab.add("5", label_5);
JFrame framee = new JFrame("Customized Check Box");
Icon im = new ImageIcon("cut.gif");
JCheckBox chk = new JCheckBox("Temperaure oil");
chk.setIcon(im);
frame.add(chk);
//dimensione_finestra
Toolkit t = Toolkit.getDefaultToolkit();
Dimension screenSize = t.getScreenSize();
double width = screenSize.getWidth();
double height= screenSize.getHeight();
double frameWidth = (width * 70.0) / 100.0;
double frameHeight = (height * 70.0) / 100.0;
frame.setSize((int)frameWidth,(int)frameHeight);
frame.setVisible(true);
}
}
vorrei creare due classi in cui in una ci sia il main e nell'altra il resto, in modo tale poi da poter aggiungere altre classi per completare l'opera
Grazie in anticipo
io ho questa classe funzionante
package CreateTabbedPane;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class CreateTabbedPane{
private static String labelPrefix_1 = "1";
private static String labelPrefix_2 = "2";
private static String labelPrefix_3 = "3";
private static String labelPrefix_4 = "4";
private static String labelPrefix_5 = "4";
public static void main(String[] args){
JLabel label_1 = new JLabel(labelPrefix_1);
JLabel label_2 = new JLabel(labelPrefix_2);
JLabel label_3 = new JLabel(labelPrefix_3);
JLabel label_4 = new JLabel(labelPrefix_4);
JLabel label_5 = new JLabel(labelPrefix_5);
//JTextField testo_1 = new JTextField(scritta_1);
JFrame frame = new JFrame("Esempio");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JTabbedPane tab = new JTabbedPane();
frame.add(tab, BorderLayout.NORTH);
tab.add("1", label_1);
tab.add("2", label_2);
tab.add("3", label_3);
tab.add("4", label_4);
tab.add("5", label_5);
JFrame framee = new JFrame("Customized Check Box");
Icon im = new ImageIcon("cut.gif");
JCheckBox chk = new JCheckBox("Temperaure oil");
chk.setIcon(im);
frame.add(chk);
//dimensione_finestra
Toolkit t = Toolkit.getDefaultToolkit();
Dimension screenSize = t.getScreenSize();
double width = screenSize.getWidth();
double height= screenSize.getHeight();
double frameWidth = (width * 70.0) / 100.0;
double frameHeight = (height * 70.0) / 100.0;
frame.setSize((int)frameWidth,(int)frameHeight);
frame.setVisible(true);
}
}
vorrei creare due classi in cui in una ci sia il main e nell'altra il resto, in modo tale poi da poter aggiungere altre classi per completare l'opera
Grazie in anticipo