Guest User

Untitled

a guest
Jul 18th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. package agenda.visao;
  2.  
  3. import java.awt.Dimension;
  4.  
  5. import javax.swing.AbstractButton;
  6. import javax.swing.JFrame;
  7. import com.jeta.forms.components.panel.FormPanel;
  8.  
  9. public abstract class TelaBase extends JFrame {
  10.  
  11. private static final long serialVersionUID = 1L;
  12. protected FormPanel formPanel;
  13.  
  14. protected TelaBase(String title, int width, int height) {
  15. super(title);
  16. this.formPanel = new FormPanel(this.getClass().getName().replaceAll("[.]", "/") + ".xml");
  17. getContentPane().add(formPanel);
  18. setDefaultCloseOperation(HIDE_ON_CLOSE);
  19.  
  20. Dimension d = new Dimension(width, height);
  21. setMinimumSize(d);
  22. setSize(d);
  23.  
  24. setLocationRelativeTo(null);
  25. }
  26.  
  27. public void setar(String campo, String valor) {
  28. formPanel.getTextField(campo).setText(valor);
  29. }
  30.  
  31. public String ler(String campo) {
  32. return formPanel.getTextField(campo).getText();
  33. }
  34.  
  35. public AbstractButton botao(String botao) {
  36. return formPanel.getButton(botao);
  37. }
  38.  
  39. public void mostrar() {
  40. setVisible(true);
  41. }
  42.  
  43. public void esconder() {
  44. setVisible(false);
  45. }
  46.  
  47. }
Add Comment
Please, Sign In to add comment