Advertisement
Guest User

Swingoodies Example

a guest
Jul 24th, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.67 KB | None | 0 0
  1. @Layout(columns = "4dlu, default, 4dlu, 100dlu:grow, 4dlu", rows = "4dlu, default, 4dlu, default, 4dlu, default:grow, 4dlu")
  2. public class TestePanel extends CustomPanel {
  3.  
  4.     @Property(iconName = "users.png")
  5.     @Location(text = "Nome:", col = 2, row = 2, alignment = Position.CENTER, position = Position.LEFT)
  6.     private JLabel      lblName;
  7.  
  8.     @Location(col = 4, row = 2, alignment = Position.FILL, position = Position.FILL)
  9.     private JTextField  txtName;
  10.  
  11.     @Property(iconName = "key.png")
  12.     @Location(text = "Senha:", col = 2, row = 4, position = Position.LEFT)
  13.     private JLabel      lblPassword;
  14.  
  15.     @Location(col = 4, row = 4, position = Position.FILL, alignment = Position.FILL)
  16.     private JTextField  txtPass;
  17.  
  18.     @Location(col = 2, row = 6, colSpan = 4, alignment = Position.FILL, position = Position.FILL)
  19.     private ButtonPanel btnPanel;
  20.  
  21.     public TestePanel() throws Exception {
  22.         super();
  23.     }
  24.  
  25.     public void setLblName(JLabel lblName) {
  26.         this.lblName = lblName;
  27.     }
  28.  
  29.     public void setTxtName(JTextField txtName) {
  30.         this.txtName = txtName;
  31.     }
  32.  
  33.     public void setLblPassword(JLabel lblPassword) {
  34.         this.lblPassword = lblPassword;
  35.     }
  36.  
  37.     public void setTxtPass(JTextField txtPass) {
  38.         this.txtPass = txtPass;
  39.     }
  40.  
  41.     public void setBtnPanel(ButtonPanel btnPanel) {
  42.         this.btnPanel = btnPanel;
  43.     }
  44.  
  45.     public static void main(String[] args) throws Exception {
  46.         UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  47.  
  48.         JFrame frame = new JFrame();
  49.         frame.setTitle("Teste @Swingoodies");
  50.         frame.setContentPane(new TestePanel());
  51.         frame.pack();
  52.         frame.setVisible(true);
  53.         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  54.         frame.setLocationRelativeTo(null);
  55.     }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement