Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.toedter.calendar.JDateChooser;
- import java.awt.BorderLayout;
- import java.awt.GridBagConstraints;
- import java.awt.GridBagLayout;
- import java.awt.Insets;
- import java.awt.event.MouseEvent;
- import java.awt.event.MouseListener;
- import java.text.DateFormat;
- import java.text.SimpleDateFormat;
- import java.util.Calendar;
- import java.util.Date;
- import javax.swing.BorderFactory;
- import javax.swing.JButton;
- import javax.swing.JLabel;
- import javax.swing.JPanel;
- import javax.swing.JSeparator;
- import javax.swing.JTextArea;
- import javax.swing.JTextField;
- import javax.swing.SwingConstants;
- import javax.swing.WindowConstants;
- import javax.swing.border.LineBorder;
- import javax.swing.SwingUtilities;
- public class F1 extends javax.swing.JFrame {
- private JPanel Panel;
- private JTextField TF_Fecha;
- private JButton Button_Next;
- private JSeparator jSeparator3;
- private JTextField TF_OI3;
- private JTextField TF_OI2;
- private JTextField TF_OI1;
- private JLabel Label_OI;
- private JTextField TF_OD3;
- private JTextField TF_OD2;
- private JTextField TF_OD1;
- private JLabel Label_Od;
- private JLabel Label_Graduacion;
- private JSeparator jSeparator2;
- private JTextArea TextArea_Comentario;
- private JLabel Label_Comentario;
- private JTextField TF_IdPaciente;
- private JLabel Label_IdPaciente;
- private JDateChooser jDateChooser1;
- private JLabel Label_FechaNacimiento;
- private JTextField TF_Nombre;
- private JLabel Label_Nombre;
- private JSeparator jSeparator1;
- private JLabel LabelFecha;
- private String Nombre;
- private String FechaNacimiento;
- private String IdPaciente;
- private String Comentarios;
- private String[] OD;
- private String[] OI;
- /**
- * Auto-generated main method to display this JFrame
- */
- public F1() {
- super();
- initGUI();
- this.TF_OD1.addMouseListener(new MouseListener() {
- public void mouseClicked(MouseEvent e) {
- }
- public void mousePressed(MouseEvent e) {
- TF_OD1.setText("");
- }
- public void mouseReleased(MouseEvent e) {
- }
- public void mouseEntered(MouseEvent e) {
- }
- public void mouseExited(MouseEvent e) {
- }
- });
- this.TF_OD2.addMouseListener(new MouseListener() {
- public void mouseClicked(MouseEvent e) {
- }
- public void mousePressed(MouseEvent e) {
- TF_OD2.setText("");
- }
- public void mouseReleased(MouseEvent e) {
- }
- public void mouseEntered(MouseEvent e) {
- }
- public void mouseExited(MouseEvent e) {
- }
- });
- this.TF_OD3.addMouseListener(new MouseListener() {
- public void mouseClicked(MouseEvent e) {
- }
- public void mousePressed(MouseEvent e) {
- TF_OD3.setText("");
- }
- public void mouseReleased(MouseEvent e) {
- }
- public void mouseEntered(MouseEvent e) {
- }
- public void mouseExited(MouseEvent e) {
- }
- });
- this.TF_OI1.addMouseListener(new MouseListener() {
- public void mouseClicked(MouseEvent e) {
- }
- public void mousePressed(MouseEvent e) {
- TF_OI1.setText("");
- }
- public void mouseReleased(MouseEvent e) {
- }
- public void mouseEntered(MouseEvent e) {
- }
- public void mouseExited(MouseEvent e) {
- }
- });
- this.TF_OI2.addMouseListener(new MouseListener() {
- public void mouseClicked(MouseEvent e) {
- }
- public void mousePressed(MouseEvent e) {
- TF_OI2.setText("");
- }
- public void mouseReleased(MouseEvent e) {
- }
- public void mouseEntered(MouseEvent e) {
- }
- public void mouseExited(MouseEvent e) {
- }
- });
- this.TF_OI3.addMouseListener(new MouseListener() {
- public void mouseClicked(MouseEvent e) {
- }
- public void mousePressed(MouseEvent e) {
- TF_OI3.setText("");
- }
- public void mouseReleased(MouseEvent e) {
- }
- public void mouseEntered(MouseEvent e) {
- }
- public void mouseExited(MouseEvent e) {
- }
- });
- this.Button_Next.addMouseListener(new MouseListener(){
- public void mouseClicked(MouseEvent e){
- }
- public void mousePressed(MouseEvent e) {
- Nombre = TF_Nombre.getText();
- //FechaNacimiento = TF_
- IdPaciente = TF_IdPaciente.getText();
- Comentarios = TextArea_Comentario.getText();
- F2 f22 = new F2();
- f22.setLocationRelativeTo(null);
- f22.setVisible(true);
- dispose();
- }
- public void mouseReleased(MouseEvent e) {
- }
- public void mouseEntered(MouseEvent e) {
- }
- public void mouseExited(MouseEvent e) {
- }
- });
- this.TF_Fecha.setText(getDateTime());
- }
- private void initGUI() {
- try {
- setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
- this.setTitle("Calculo de la Agudeza Visual");
- this.setResizable(false);
- {
- Panel = new JPanel();
- getContentPane().add(Panel, BorderLayout.CENTER);
- GridBagLayout PanelLayout = new GridBagLayout();
- PanelLayout.columnWidths = new int[] {7, 43, 7, 36, 54, 15, 55, 15, 54, 7};
- PanelLayout.rowHeights = new int[] {35, 6, 20, 20, 20, 20, 20, 15, 11, 18, 30, 30, 24, 22, 25};
- PanelLayout.columnWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1};
- PanelLayout.rowWeights = new double[] {0.0, 0.0, 0.1, 0.1, 0.1, 0.1, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
- Panel.setLayout(PanelLayout);
- Panel.setPreferredSize(new java.awt.Dimension(406, 397));
- {
- LabelFecha = new JLabel();
- Panel.add(LabelFecha, new GridBagConstraints(6, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- LabelFecha.setText("Fecha:");
- LabelFecha.setHorizontalAlignment(SwingConstants.CENTER);
- }
- {
- TF_Fecha = new JTextField();
- Panel.add(TF_Fecha, new GridBagConstraints(8, 0, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 10), 0, 0));
- TF_Fecha.setHorizontalAlignment(SwingConstants.CENTER);
- TF_Fecha.setEnabled(false);
- TF_Fecha.setFont(new java.awt.Font("Tahoma",1,11));
- }
- {
- jSeparator1 = new JSeparator();
- Panel.add(jSeparator1, new GridBagConstraints(0, 1, 10, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- }
- {
- Label_Nombre = new JLabel();
- Panel.add(Label_Nombre, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- Label_Nombre.setText("Nombre :");
- Label_Nombre.setHorizontalAlignment(SwingConstants.CENTER);
- }
- {
- TF_Nombre = new JTextField();
- Panel.add(TF_Nombre, new GridBagConstraints(3, 2, 5, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- }
- {
- Label_FechaNacimiento = new JLabel();
- Panel.add(Label_FechaNacimiento, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- Label_FechaNacimiento.setText("Fecha Nacimiento :");
- }
- {
- jDateChooser1 = new JDateChooser();
- Panel.add(jDateChooser1, new GridBagConstraints(3, 3, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- }
- {
- Label_IdPaciente = new JLabel();
- Panel.add(Label_IdPaciente, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- Label_IdPaciente.setText("Id Paciente :");
- Label_IdPaciente.setHorizontalTextPosition(SwingConstants.LEADING);
- Label_IdPaciente.setHorizontalAlignment(SwingConstants.CENTER);
- }
- {
- TF_IdPaciente = new JTextField();
- Panel.add(TF_IdPaciente, new GridBagConstraints(3, 4, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- }
- {
- Label_Comentario = new JLabel();
- Panel.add(Label_Comentario, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- Label_Comentario.setText("Comentarios :");
- Label_Comentario.setHorizontalAlignment(SwingConstants.CENTER);
- }
- {
- TextArea_Comentario = new JTextArea();
- Panel.add(TextArea_Comentario, new GridBagConstraints(3, 5, 5, 2, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
- TextArea_Comentario.setAutoscrolls(false);
- TextArea_Comentario.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
- }
- {
- jSeparator2 = new JSeparator();
- Panel.add(jSeparator2, new GridBagConstraints(0, 8, 10, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- }
- {
- Label_Graduacion = new JLabel();
- Panel.add(Label_Graduacion, new GridBagConstraints(1, 9, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- Label_Graduacion.setText("Graduacion :");
- Label_Graduacion.setHorizontalAlignment(SwingConstants.CENTER);
- }
- {
- Label_Od = new JLabel();
- Panel.add(Label_Od, new GridBagConstraints(3, 10, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- Label_Od.setText("O.D :");
- Label_Od.setHorizontalAlignment(SwingConstants.CENTER);
- }
- {
- TF_OD1 = new JTextField();
- Panel.add(TF_OD1, new GridBagConstraints(4, 10, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- TF_OD1.setText("Esf");
- TF_OD1.setHorizontalAlignment(SwingConstants.CENTER);
- }
- {
- TF_OD2 = new JTextField();
- Panel.add(TF_OD2, new GridBagConstraints(6, 10, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- TF_OD2.setText("Cil");
- TF_OD2.setHorizontalAlignment(SwingConstants.CENTER);
- }
- {
- TF_OD3 = new JTextField();
- Panel.add(TF_OD3, new GridBagConstraints(8, 10, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- TF_OD3.setText("Ang");
- TF_OD3.setHorizontalAlignment(SwingConstants.CENTER);
- }
- {
- Label_OI = new JLabel();
- Panel.add(Label_OI, new GridBagConstraints(3, 11, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- Label_OI.setText("O.I :");
- Label_OI.setHorizontalAlignment(SwingConstants.CENTER);
- }
- {
- TF_OI1 = new JTextField();
- Panel.add(TF_OI1, new GridBagConstraints(4, 11, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- TF_OI1.setText("Esf");
- TF_OI1.setHorizontalAlignment(SwingConstants.CENTER);
- }
- {
- TF_OI2 = new JTextField();
- Panel.add(TF_OI2, new GridBagConstraints(6, 11, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- TF_OI2.setText("Cil");
- TF_OI2.setHorizontalAlignment(SwingConstants.CENTER);
- }
- {
- TF_OI3 = new JTextField();
- Panel.add(TF_OI3, new GridBagConstraints(8, 11, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- TF_OI3.setText("Ang");
- TF_OI3.setHorizontalAlignment(SwingConstants.CENTER);
- }
- {
- jSeparator3 = new JSeparator();
- Panel.add(jSeparator3, new GridBagConstraints(0, 12, 10, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- }
- {
- Button_Next = new JButton();
- Panel.add(Button_Next, new GridBagConstraints(9, 13, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- Button_Next.setText("Empezar");
- }
- }
- pack();
- this.setSize(448, 531);
- } catch (Exception e) {
- //add your error handling code here
- e.printStackTrace();
- }
- }
- // mis clases
- private String getDateTime() {
- DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy ");
- Date date = new Date();
- return dateFormat.format(date);
- }
- public void actualizardatos(Datas d){
- }
- }
- import java.awt.BorderLayout;
- import java.awt.Color;
- import java.awt.GridBagConstraints;
- import java.awt.GridBagLayout;
- import java.awt.Insets;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import javax.swing.JButton;
- import javax.swing.JColorChooser;
- import javax.swing.JLabel;
- import javax.swing.JPanel;
- import javax.swing.JRadioButton;
- import javax.swing.JSeparator;
- import javax.swing.JTextField;
- import javax.swing.SwingConstants;
- import javax.swing.WindowConstants;
- import javax.swing.SwingUtilities;
- public class F2 extends javax.swing.JFrame {
- private JPanel Panel;
- private JTextField TF_Resolucion;
- private JTextField TF_AnchoPantalla;
- private JButton Button_Next;
- private JSeparator jSeparator1;
- private JRadioButton RadioButton_OI;
- private JLabel Label_OI;
- private JRadioButton jRadioButton_OD;
- private JLabel Label_OD;
- private JLabel Label_Tipo;
- private JTextField TF_Distancia;
- private JLabel Label_Distancia;
- private JTextField TF_AltoPantalla;
- private JLabel Label_AltoP;
- private JLabel Label_AnchoP;
- private JLabel Label_Resolucion;
- private JTextField TF_ColorLetra;
- private JButton Button_ColorLetra;
- private JTextField TF_ColorFondo;
- private JButton Button_ColorFonfo;
- /**
- * Auto-generated main method to display this JFrame
- */
- public F2() {
- super();
- initGUI();
- ProcColorLetra cl = new ProcColorLetra();
- this.Button_ColorLetra.addActionListener(cl);
- ProcColorFondo cf = new ProcColorFondo();
- Button_ColorFonfo.addActionListener(cf);
- GetScreenSize SS = new GetScreenSize();
- TF_Resolucion.setText(SS.ancho + " x " + SS.alto);
- }
- private void initGUI() {
- try {
- setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
- {
- Panel = new JPanel();
- GridBagLayout PanelLayout = new GridBagLayout();
- PanelLayout.columnWidths = new int[] {7, 20, 7, 7, 20, 44, 36, 43, 7};
- PanelLayout.rowHeights = new int[] {7, 20, 20, 7, 7, 7, 20, 12, 20, 14, 7};
- PanelLayout.columnWeights = new double[] {0.0, 0.1, 0.0, 0.1, 0.1, 0.0, 0.0, 0.0, 0.1};
- PanelLayout.rowWeights = new double[] {0.0, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.0, 0.0, 0.0, 0.0};
- getContentPane().add(Panel, BorderLayout.CENTER);
- Panel.setLayout(PanelLayout);
- {
- Button_ColorFonfo = new JButton();
- Panel.add(Button_ColorFonfo, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- Button_ColorFonfo.setText("Color Fondo :");
- }
- {
- TF_ColorFondo = new JTextField();
- Panel.add(TF_ColorFondo, new GridBagConstraints(3, 1, 4, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- TF_ColorFondo.setHorizontalAlignment(SwingConstants.CENTER);
- TF_ColorFondo.setEnabled(false);
- TF_ColorFondo.setFont(new java.awt.Font("Tahoma",1,11));
- }
- {
- Button_ColorLetra = new JButton();
- Panel.add(Button_ColorLetra, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- Button_ColorLetra.setText("Color Letra :");
- }
- {
- TF_ColorLetra = new JTextField();
- Panel.add(TF_ColorLetra, new GridBagConstraints(3, 2, 4, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- TF_ColorLetra.setHorizontalAlignment(SwingConstants.CENTER);
- TF_ColorLetra.setEnabled(false);
- TF_ColorLetra.setFont(new java.awt.Font("Tahoma",1,11));
- }
- {
- Label_Resolucion = new JLabel();
- Panel.add(Label_Resolucion, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- Label_Resolucion.setText("Resolucion Pantalla :");
- Label_Resolucion.setHorizontalAlignment(SwingConstants.CENTER);
- }
- {
- TF_Resolucion = new JTextField();
- Panel.add(TF_Resolucion, new GridBagConstraints(3, 3, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- TF_Resolucion.setHorizontalAlignment(SwingConstants.CENTER);
- TF_Resolucion.setEnabled(false);
- TF_Resolucion.setFont(new java.awt.Font("Tahoma",1,11));
- }
- {
- Label_AnchoP = new JLabel();
- Panel.add(Label_AnchoP, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- Label_AnchoP.setText("Ancho Pantalla :");
- Label_AnchoP.setHorizontalAlignment(SwingConstants.CENTER);
- }
- {
- TF_AnchoPantalla = new JTextField();
- Panel.add(TF_AnchoPantalla, new GridBagConstraints(3, 4, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- TF_AnchoPantalla.setHorizontalAlignment(SwingConstants.CENTER);
- }
- {
- Label_AltoP = new JLabel();
- Panel.add(Label_AltoP, new GridBagConstraints(5, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 8, 0, 0), 0, 0));
- Label_AltoP.setText("Alto Pantalla :");
- Label_AltoP.setHorizontalAlignment(SwingConstants.CENTER);
- }
- {
- TF_AltoPantalla = new JTextField();
- Panel.add(TF_AltoPantalla, new GridBagConstraints(6, 4, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- TF_AltoPantalla.setHorizontalAlignment(SwingConstants.CENTER);
- }
- {
- Label_Distancia = new JLabel();
- Panel.add(Label_Distancia, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- Label_Distancia.setText("Distancia");
- Label_Distancia.setHorizontalTextPosition(SwingConstants.LEADING);
- Label_Distancia.setHorizontalAlignment(SwingConstants.CENTER);
- }
- {
- TF_Distancia = new JTextField();
- Panel.add(TF_Distancia, new GridBagConstraints(3, 5, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- TF_Distancia.setHorizontalAlignment(SwingConstants.CENTER);
- }
- {
- Label_Tipo = new JLabel();
- Panel.add(Label_Tipo, new GridBagConstraints(1, 6, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- Label_Tipo.setText("Tipo Test :");
- Label_Tipo.setHorizontalAlignment(SwingConstants.CENTER);
- }
- {
- Label_OD = new JLabel();
- Panel.add(Label_OD, new GridBagConstraints(3, 6, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- Label_OD.setText("O.D :");
- Label_OD.setHorizontalAlignment(SwingConstants.CENTER);
- }
- {
- jRadioButton_OD = new JRadioButton();
- Panel.add(jRadioButton_OD, new GridBagConstraints(4, 6, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- }
- {
- Label_OI = new JLabel();
- Panel.add(Label_OI, new GridBagConstraints(5, 6, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- Label_OI.setText("O.I :");
- Label_OI.setHorizontalAlignment(SwingConstants.CENTER);
- }
- {
- RadioButton_OI = new JRadioButton();
- Panel.add(RadioButton_OI, new GridBagConstraints(6, 6, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- }
- {
- jSeparator1 = new JSeparator();
- Panel.add(jSeparator1, new GridBagConstraints(1, 7, 8, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- }
- {
- Button_Next = new JButton();
- Panel.add(Button_Next, new GridBagConstraints(7, 9, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- Button_Next.setText("Siguiente");
- }
- }
- pack();
- this.setSize(446, 321);
- } catch (Exception e) {
- //add your error handling code here
- e.printStackTrace();
- }
- }
- //clases de los receptores
- class ProcColorFondo implements ActionListener{
- public void actionPerformed(ActionEvent e){
- Color CFondo = JColorChooser.showDialog(null, "JColorChooser Sample", null);
- if(CFondo != null){
- TF_ColorFondo.setText("R="+ String.valueOf(CFondo.getRed()) + ", B=" + String.valueOf(CFondo.getBlue()) + ", G="+ String.valueOf(CFondo.getGreen()) );
- }
- }
- }
- class ProcColorLetra implements ActionListener{
- public void actionPerformed(ActionEvent e){
- Color CFondo = JColorChooser.showDialog(null, "JColorChooser Sample", null);
- if(CFondo != null){
- TF_ColorLetra.setText("R="+ String.valueOf(CFondo.getRed()) + ", B=" + String.valueOf(CFondo.getBlue()) + ", G="+ String.valueOf(CFondo.getGreen()) );
- }
- }
- }
- }
- import javax.swing.SwingUtilities;
- public class MainClass {
- /**
- * @param args
- */
- public MainClass() {
- super();
- }
- public static void main(String[] args) {
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- Datas d = new Datas();
- F1 f = new F1();
- f.setLocationRelativeTo(null);
- f.setVisible(true);
- }
- });
- }
- }
Add Comment
Please, Sign In to add comment