Guest User

Untitled

a guest
Mar 17th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.00 KB | None | 0 0
  1. import com.toedter.calendar.JDateChooser;
  2. import java.awt.BorderLayout;
  3. import java.awt.GridBagConstraints;
  4. import java.awt.GridBagLayout;
  5. import java.awt.Insets;
  6. import java.awt.event.MouseEvent;
  7. import java.awt.event.MouseListener;
  8. import java.text.DateFormat;
  9. import java.text.SimpleDateFormat;
  10. import java.util.Calendar;
  11. import java.util.Date;
  12.  
  13. import javax.swing.BorderFactory;
  14. import javax.swing.JButton;
  15. import javax.swing.JLabel;
  16. import javax.swing.JPanel;
  17. import javax.swing.JSeparator;
  18. import javax.swing.JTextArea;
  19. import javax.swing.JTextField;
  20. import javax.swing.SwingConstants;
  21.  
  22. import javax.swing.WindowConstants;
  23. import javax.swing.border.LineBorder;
  24. import javax.swing.SwingUtilities;
  25.  
  26.  
  27.  
  28.  
  29.  
  30. public class F1 extends javax.swing.JFrame {
  31. private JPanel Panel;
  32. private JTextField TF_Fecha;
  33. private JButton Button_Next;
  34. private JSeparator jSeparator3;
  35. private JTextField TF_OI3;
  36. private JTextField TF_OI2;
  37. private JTextField TF_OI1;
  38. private JLabel Label_OI;
  39. private JTextField TF_OD3;
  40. private JTextField TF_OD2;
  41. private JTextField TF_OD1;
  42. private JLabel Label_Od;
  43. private JLabel Label_Graduacion;
  44. private JSeparator jSeparator2;
  45. private JTextArea TextArea_Comentario;
  46. private JLabel Label_Comentario;
  47. private JTextField TF_IdPaciente;
  48. private JLabel Label_IdPaciente;
  49. private JDateChooser jDateChooser1;
  50. private JLabel Label_FechaNacimiento;
  51. private JTextField TF_Nombre;
  52. private JLabel Label_Nombre;
  53. private JSeparator jSeparator1;
  54. private JLabel LabelFecha;
  55.  
  56.  
  57. private String Nombre;
  58. private String FechaNacimiento;
  59. private String IdPaciente;
  60. private String Comentarios;
  61. private String[] OD;
  62. private String[] OI;
  63. /**
  64. * Auto-generated main method to display this JFrame
  65. */
  66.  
  67. public F1() {
  68. super();
  69. initGUI();
  70.  
  71. this.TF_OD1.addMouseListener(new MouseListener() {
  72.  
  73. public void mouseClicked(MouseEvent e) {
  74.  
  75. }
  76.  
  77. public void mousePressed(MouseEvent e) {
  78. TF_OD1.setText("");
  79.  
  80. }
  81.  
  82. public void mouseReleased(MouseEvent e) {
  83.  
  84. }
  85.  
  86. public void mouseEntered(MouseEvent e) {
  87.  
  88. }
  89.  
  90. public void mouseExited(MouseEvent e) {
  91.  
  92. }
  93.  
  94. });
  95. this.TF_OD2.addMouseListener(new MouseListener() {
  96.  
  97. public void mouseClicked(MouseEvent e) {
  98.  
  99. }
  100.  
  101. public void mousePressed(MouseEvent e) {
  102. TF_OD2.setText("");
  103. }
  104.  
  105. public void mouseReleased(MouseEvent e) {
  106.  
  107. }
  108.  
  109. public void mouseEntered(MouseEvent e) {
  110.  
  111. }
  112.  
  113. public void mouseExited(MouseEvent e) {
  114.  
  115. }
  116.  
  117. });
  118. this.TF_OD3.addMouseListener(new MouseListener() {
  119.  
  120. public void mouseClicked(MouseEvent e) {
  121.  
  122. }
  123.  
  124. public void mousePressed(MouseEvent e) {
  125. TF_OD3.setText("");
  126. }
  127.  
  128. public void mouseReleased(MouseEvent e) {
  129.  
  130. }
  131.  
  132. public void mouseEntered(MouseEvent e) {
  133.  
  134. }
  135.  
  136. public void mouseExited(MouseEvent e) {
  137.  
  138. }
  139.  
  140. });
  141. this.TF_OI1.addMouseListener(new MouseListener() {
  142.  
  143. public void mouseClicked(MouseEvent e) {
  144.  
  145. }
  146.  
  147. public void mousePressed(MouseEvent e) {
  148. TF_OI1.setText("");
  149. }
  150.  
  151. public void mouseReleased(MouseEvent e) {
  152.  
  153. }
  154.  
  155. public void mouseEntered(MouseEvent e) {
  156.  
  157. }
  158.  
  159. public void mouseExited(MouseEvent e) {
  160.  
  161. }
  162.  
  163. });
  164. this.TF_OI2.addMouseListener(new MouseListener() {
  165.  
  166. public void mouseClicked(MouseEvent e) {
  167.  
  168. }
  169.  
  170. public void mousePressed(MouseEvent e) {
  171. TF_OI2.setText("");
  172. }
  173.  
  174. public void mouseReleased(MouseEvent e) {
  175.  
  176. }
  177.  
  178. public void mouseEntered(MouseEvent e) {
  179.  
  180. }
  181.  
  182. public void mouseExited(MouseEvent e) {
  183.  
  184. }
  185.  
  186. });
  187. this.TF_OI3.addMouseListener(new MouseListener() {
  188.  
  189. public void mouseClicked(MouseEvent e) {
  190.  
  191. }
  192.  
  193. public void mousePressed(MouseEvent e) {
  194. TF_OI3.setText("");
  195. }
  196.  
  197. public void mouseReleased(MouseEvent e) {
  198.  
  199. }
  200.  
  201. public void mouseEntered(MouseEvent e) {
  202.  
  203. }
  204.  
  205. public void mouseExited(MouseEvent e) {
  206.  
  207. }
  208.  
  209. });
  210. this.Button_Next.addMouseListener(new MouseListener(){
  211. public void mouseClicked(MouseEvent e){
  212.  
  213. }
  214. public void mousePressed(MouseEvent e) {
  215. Nombre = TF_Nombre.getText();
  216. //FechaNacimiento = TF_
  217. IdPaciente = TF_IdPaciente.getText();
  218. Comentarios = TextArea_Comentario.getText();
  219.  
  220.  
  221.  
  222. F2 f22 = new F2();
  223. f22.setLocationRelativeTo(null);
  224. f22.setVisible(true);
  225.  
  226.  
  227.  
  228.  
  229. dispose();
  230.  
  231. }
  232.  
  233. public void mouseReleased(MouseEvent e) {
  234.  
  235. }
  236.  
  237. public void mouseEntered(MouseEvent e) {
  238.  
  239. }
  240.  
  241. public void mouseExited(MouseEvent e) {
  242.  
  243. }
  244. });
  245.  
  246. this.TF_Fecha.setText(getDateTime());
  247.  
  248.  
  249.  
  250.  
  251.  
  252. }
  253.  
  254. private void initGUI() {
  255. try {
  256. setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
  257. this.setTitle("Calculo de la Agudeza Visual");
  258. this.setResizable(false);
  259. {
  260. Panel = new JPanel();
  261. getContentPane().add(Panel, BorderLayout.CENTER);
  262. GridBagLayout PanelLayout = new GridBagLayout();
  263. PanelLayout.columnWidths = new int[] {7, 43, 7, 36, 54, 15, 55, 15, 54, 7};
  264. PanelLayout.rowHeights = new int[] {35, 6, 20, 20, 20, 20, 20, 15, 11, 18, 30, 30, 24, 22, 25};
  265. PanelLayout.columnWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1};
  266. 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};
  267. Panel.setLayout(PanelLayout);
  268. Panel.setPreferredSize(new java.awt.Dimension(406, 397));
  269. {
  270. LabelFecha = new JLabel();
  271. 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));
  272. LabelFecha.setText("Fecha:");
  273. LabelFecha.setHorizontalAlignment(SwingConstants.CENTER);
  274. }
  275. {
  276. TF_Fecha = new JTextField();
  277. 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));
  278. TF_Fecha.setHorizontalAlignment(SwingConstants.CENTER);
  279. TF_Fecha.setEnabled(false);
  280. TF_Fecha.setFont(new java.awt.Font("Tahoma",1,11));
  281. }
  282. {
  283. jSeparator1 = new JSeparator();
  284. 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));
  285. }
  286. {
  287. Label_Nombre = new JLabel();
  288. 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));
  289. Label_Nombre.setText("Nombre :");
  290. Label_Nombre.setHorizontalAlignment(SwingConstants.CENTER);
  291. }
  292. {
  293. TF_Nombre = new JTextField();
  294. 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));
  295. }
  296. {
  297. Label_FechaNacimiento = new JLabel();
  298. 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));
  299. Label_FechaNacimiento.setText("Fecha Nacimiento :");
  300. }
  301. {
  302. jDateChooser1 = new JDateChooser();
  303. 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));
  304. }
  305. {
  306. Label_IdPaciente = new JLabel();
  307. 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));
  308. Label_IdPaciente.setText("Id Paciente :");
  309. Label_IdPaciente.setHorizontalTextPosition(SwingConstants.LEADING);
  310. Label_IdPaciente.setHorizontalAlignment(SwingConstants.CENTER);
  311. }
  312. {
  313. TF_IdPaciente = new JTextField();
  314. 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));
  315. }
  316. {
  317. Label_Comentario = new JLabel();
  318. 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));
  319. Label_Comentario.setText("Comentarios :");
  320. Label_Comentario.setHorizontalAlignment(SwingConstants.CENTER);
  321. }
  322. {
  323. TextArea_Comentario = new JTextArea();
  324. 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));
  325. TextArea_Comentario.setAutoscrolls(false);
  326. TextArea_Comentario.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
  327. }
  328. {
  329. jSeparator2 = new JSeparator();
  330. 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));
  331. }
  332. {
  333. Label_Graduacion = new JLabel();
  334. 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));
  335. Label_Graduacion.setText("Graduacion :");
  336. Label_Graduacion.setHorizontalAlignment(SwingConstants.CENTER);
  337. }
  338. {
  339. Label_Od = new JLabel();
  340. 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));
  341. Label_Od.setText("O.D :");
  342. Label_Od.setHorizontalAlignment(SwingConstants.CENTER);
  343. }
  344. {
  345. TF_OD1 = new JTextField();
  346. 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));
  347. TF_OD1.setText("Esf");
  348. TF_OD1.setHorizontalAlignment(SwingConstants.CENTER);
  349. }
  350. {
  351. TF_OD2 = new JTextField();
  352. 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));
  353. TF_OD2.setText("Cil");
  354. TF_OD2.setHorizontalAlignment(SwingConstants.CENTER);
  355. }
  356. {
  357. TF_OD3 = new JTextField();
  358. 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));
  359. TF_OD3.setText("Ang");
  360. TF_OD3.setHorizontalAlignment(SwingConstants.CENTER);
  361. }
  362. {
  363. Label_OI = new JLabel();
  364. 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));
  365. Label_OI.setText("O.I :");
  366. Label_OI.setHorizontalAlignment(SwingConstants.CENTER);
  367. }
  368. {
  369. TF_OI1 = new JTextField();
  370. 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));
  371. TF_OI1.setText("Esf");
  372. TF_OI1.setHorizontalAlignment(SwingConstants.CENTER);
  373. }
  374. {
  375. TF_OI2 = new JTextField();
  376. 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));
  377. TF_OI2.setText("Cil");
  378. TF_OI2.setHorizontalAlignment(SwingConstants.CENTER);
  379. }
  380. {
  381. TF_OI3 = new JTextField();
  382. 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));
  383. TF_OI3.setText("Ang");
  384. TF_OI3.setHorizontalAlignment(SwingConstants.CENTER);
  385. }
  386. {
  387. jSeparator3 = new JSeparator();
  388. 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));
  389. }
  390. {
  391. Button_Next = new JButton();
  392. 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));
  393. Button_Next.setText("Empezar");
  394. }
  395. }
  396. pack();
  397. this.setSize(448, 531);
  398. } catch (Exception e) {
  399. //add your error handling code here
  400. e.printStackTrace();
  401. }
  402. }
  403. // mis clases
  404.  
  405. private String getDateTime() {
  406. DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy ");
  407. Date date = new Date();
  408. return dateFormat.format(date);
  409. }
  410. public void actualizardatos(Datas d){
  411.  
  412. }
  413.  
  414.  
  415. }
  416.  
  417. import java.awt.BorderLayout;
  418. import java.awt.Color;
  419. import java.awt.GridBagConstraints;
  420. import java.awt.GridBagLayout;
  421. import java.awt.Insets;
  422. import java.awt.event.ActionEvent;
  423. import java.awt.event.ActionListener;
  424.  
  425. import javax.swing.JButton;
  426. import javax.swing.JColorChooser;
  427. import javax.swing.JLabel;
  428. import javax.swing.JPanel;
  429. import javax.swing.JRadioButton;
  430. import javax.swing.JSeparator;
  431. import javax.swing.JTextField;
  432. import javax.swing.SwingConstants;
  433.  
  434. import javax.swing.WindowConstants;
  435. import javax.swing.SwingUtilities;
  436.  
  437.  
  438. public class F2 extends javax.swing.JFrame {
  439. private JPanel Panel;
  440. private JTextField TF_Resolucion;
  441. private JTextField TF_AnchoPantalla;
  442. private JButton Button_Next;
  443. private JSeparator jSeparator1;
  444. private JRadioButton RadioButton_OI;
  445. private JLabel Label_OI;
  446. private JRadioButton jRadioButton_OD;
  447. private JLabel Label_OD;
  448. private JLabel Label_Tipo;
  449. private JTextField TF_Distancia;
  450. private JLabel Label_Distancia;
  451. private JTextField TF_AltoPantalla;
  452. private JLabel Label_AltoP;
  453. private JLabel Label_AnchoP;
  454. private JLabel Label_Resolucion;
  455. private JTextField TF_ColorLetra;
  456. private JButton Button_ColorLetra;
  457. private JTextField TF_ColorFondo;
  458. private JButton Button_ColorFonfo;
  459.  
  460. /**
  461. * Auto-generated main method to display this JFrame
  462. */
  463.  
  464. public F2() {
  465. super();
  466. initGUI();
  467. ProcColorLetra cl = new ProcColorLetra();
  468. this.Button_ColorLetra.addActionListener(cl);
  469.  
  470. ProcColorFondo cf = new ProcColorFondo();
  471. Button_ColorFonfo.addActionListener(cf);
  472.  
  473. GetScreenSize SS = new GetScreenSize();
  474. TF_Resolucion.setText(SS.ancho + " x " + SS.alto);
  475.  
  476. }
  477.  
  478. private void initGUI() {
  479. try {
  480. setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
  481. {
  482. Panel = new JPanel();
  483. GridBagLayout PanelLayout = new GridBagLayout();
  484. PanelLayout.columnWidths = new int[] {7, 20, 7, 7, 20, 44, 36, 43, 7};
  485. PanelLayout.rowHeights = new int[] {7, 20, 20, 7, 7, 7, 20, 12, 20, 14, 7};
  486. PanelLayout.columnWeights = new double[] {0.0, 0.1, 0.0, 0.1, 0.1, 0.0, 0.0, 0.0, 0.1};
  487. 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};
  488. getContentPane().add(Panel, BorderLayout.CENTER);
  489. Panel.setLayout(PanelLayout);
  490. {
  491. Button_ColorFonfo = new JButton();
  492. 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));
  493. Button_ColorFonfo.setText("Color Fondo :");
  494. }
  495. {
  496. TF_ColorFondo = new JTextField();
  497. 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));
  498. TF_ColorFondo.setHorizontalAlignment(SwingConstants.CENTER);
  499. TF_ColorFondo.setEnabled(false);
  500. TF_ColorFondo.setFont(new java.awt.Font("Tahoma",1,11));
  501. }
  502. {
  503. Button_ColorLetra = new JButton();
  504. 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));
  505. Button_ColorLetra.setText("Color Letra :");
  506. }
  507. {
  508. TF_ColorLetra = new JTextField();
  509. 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));
  510. TF_ColorLetra.setHorizontalAlignment(SwingConstants.CENTER);
  511. TF_ColorLetra.setEnabled(false);
  512. TF_ColorLetra.setFont(new java.awt.Font("Tahoma",1,11));
  513. }
  514. {
  515. Label_Resolucion = new JLabel();
  516. 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));
  517. Label_Resolucion.setText("Resolucion Pantalla :");
  518. Label_Resolucion.setHorizontalAlignment(SwingConstants.CENTER);
  519. }
  520. {
  521. TF_Resolucion = new JTextField();
  522. 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));
  523. TF_Resolucion.setHorizontalAlignment(SwingConstants.CENTER);
  524. TF_Resolucion.setEnabled(false);
  525. TF_Resolucion.setFont(new java.awt.Font("Tahoma",1,11));
  526. }
  527. {
  528. Label_AnchoP = new JLabel();
  529. 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));
  530. Label_AnchoP.setText("Ancho Pantalla :");
  531. Label_AnchoP.setHorizontalAlignment(SwingConstants.CENTER);
  532. }
  533. {
  534. TF_AnchoPantalla = new JTextField();
  535. 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));
  536. TF_AnchoPantalla.setHorizontalAlignment(SwingConstants.CENTER);
  537. }
  538. {
  539. Label_AltoP = new JLabel();
  540. 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));
  541. Label_AltoP.setText("Alto Pantalla :");
  542. Label_AltoP.setHorizontalAlignment(SwingConstants.CENTER);
  543. }
  544. {
  545. TF_AltoPantalla = new JTextField();
  546. 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));
  547. TF_AltoPantalla.setHorizontalAlignment(SwingConstants.CENTER);
  548. }
  549. {
  550. Label_Distancia = new JLabel();
  551. 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));
  552. Label_Distancia.setText("Distancia");
  553. Label_Distancia.setHorizontalTextPosition(SwingConstants.LEADING);
  554. Label_Distancia.setHorizontalAlignment(SwingConstants.CENTER);
  555. }
  556. {
  557. TF_Distancia = new JTextField();
  558. 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));
  559. TF_Distancia.setHorizontalAlignment(SwingConstants.CENTER);
  560. }
  561. {
  562. Label_Tipo = new JLabel();
  563. 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));
  564. Label_Tipo.setText("Tipo Test :");
  565. Label_Tipo.setHorizontalAlignment(SwingConstants.CENTER);
  566. }
  567. {
  568. Label_OD = new JLabel();
  569. 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));
  570. Label_OD.setText("O.D :");
  571. Label_OD.setHorizontalAlignment(SwingConstants.CENTER);
  572. }
  573. {
  574. jRadioButton_OD = new JRadioButton();
  575. 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));
  576. }
  577. {
  578. Label_OI = new JLabel();
  579. 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));
  580. Label_OI.setText("O.I :");
  581. Label_OI.setHorizontalAlignment(SwingConstants.CENTER);
  582. }
  583. {
  584. RadioButton_OI = new JRadioButton();
  585. 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));
  586. }
  587. {
  588. jSeparator1 = new JSeparator();
  589. 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));
  590. }
  591. {
  592. Button_Next = new JButton();
  593. 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));
  594. Button_Next.setText("Siguiente");
  595. }
  596. }
  597. pack();
  598. this.setSize(446, 321);
  599. } catch (Exception e) {
  600. //add your error handling code here
  601. e.printStackTrace();
  602. }
  603. }
  604.  
  605. //clases de los receptores
  606.  
  607. class ProcColorFondo implements ActionListener{
  608. public void actionPerformed(ActionEvent e){
  609. Color CFondo = JColorChooser.showDialog(null, "JColorChooser Sample", null);
  610.  
  611. if(CFondo != null){
  612.  
  613. TF_ColorFondo.setText("R="+ String.valueOf(CFondo.getRed()) + ", B=" + String.valueOf(CFondo.getBlue()) + ", G="+ String.valueOf(CFondo.getGreen()) );
  614. }
  615. }
  616.  
  617. }
  618.  
  619. class ProcColorLetra implements ActionListener{
  620. public void actionPerformed(ActionEvent e){
  621. Color CFondo = JColorChooser.showDialog(null, "JColorChooser Sample", null);
  622.  
  623. if(CFondo != null){
  624.  
  625. TF_ColorLetra.setText("R="+ String.valueOf(CFondo.getRed()) + ", B=" + String.valueOf(CFondo.getBlue()) + ", G="+ String.valueOf(CFondo.getGreen()) );
  626.  
  627. }
  628. }
  629.  
  630. }
  631.  
  632.  
  633. }
  634. import javax.swing.SwingUtilities;
  635.  
  636.  
  637. public class MainClass {
  638.  
  639. /**
  640. * @param args
  641. */
  642.  
  643. public MainClass() {
  644. super();
  645. }
  646.  
  647. public static void main(String[] args) {
  648. SwingUtilities.invokeLater(new Runnable() {
  649. public void run() {
  650.  
  651. Datas d = new Datas();
  652. F1 f = new F1();
  653. f.setLocationRelativeTo(null);
  654. f.setVisible(true);
  655.  
  656.  
  657.  
  658. }
  659. });
  660. }
  661. }
Add Comment
Please, Sign In to add comment