Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package agenda.visao;
- import java.awt.Dimension;
- import javax.swing.AbstractButton;
- import javax.swing.JFrame;
- import com.jeta.forms.components.panel.FormPanel;
- public abstract class TelaBase extends JFrame {
- private static final long serialVersionUID = 1L;
- protected FormPanel formPanel;
- protected TelaBase(String title, int width, int height) {
- super(title);
- this.formPanel = new FormPanel(this.getClass().getName().replaceAll("[.]", "/") + ".xml");
- getContentPane().add(formPanel);
- setDefaultCloseOperation(HIDE_ON_CLOSE);
- Dimension d = new Dimension(width, height);
- setMinimumSize(d);
- setSize(d);
- setLocationRelativeTo(null);
- }
- public void setar(String campo, String valor) {
- formPanel.getTextField(campo).setText(valor);
- }
- public String ler(String campo) {
- return formPanel.getTextField(campo).getText();
- }
- public AbstractButton botao(String botao) {
- return formPanel.getButton(botao);
- }
- public void mostrar() {
- setVisible(true);
- }
- public void esconder() {
- setVisible(false);
- }
- }
Add Comment
Please, Sign In to add comment