InfoPane.java 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package gui.panels.agenda;
  2. import java.awt.Color;
  3. import java.awt.GridBagConstraints;
  4. import java.awt.GridBagLayout;
  5. import java.awt.Insets;
  6. import javax.swing.JPanel;
  7. import javax.swing.border.LineBorder;
  8. @SuppressWarnings("serial")
  9. public class InfoPane extends JPanel{
  10. public InfoPane(){
  11. this.setBorder(new LineBorder(new Color(0, 0, 0), 1, true));
  12. this.setLayout(new GridBagLayout());
  13. upperText();
  14. middleText();
  15. }
  16. public void upperText(){
  17. InfoField upperPanel = new InfoField("Info upper","Blablablabla blablabla");
  18. GridBagConstraints c = new GridBagConstraints();
  19. c.fill = GridBagConstraints.HORIZONTAL;
  20. c.anchor = GridBagConstraints.NORTH;
  21. c.insets = new Insets(0,20,0,20);
  22. c.gridx = 2;
  23. c.gridy = 0;
  24. c.weightx = 1.0;
  25. c.weighty = 0.0;
  26. this.add(upperPanel,c);
  27. }
  28. public void middleText(){
  29. InfoField middlePanel = new InfoField("Info mid","Blablablabla");
  30. GridBagConstraints c = new GridBagConstraints();
  31. c = new GridBagConstraints();
  32. c.fill = GridBagConstraints.BOTH;
  33. c.insets = new Insets(0,20,0,20);
  34. c.gridx = 2;
  35. c.gridy = 1;
  36. c.weightx = 1.0;
  37. c.weighty = 1.0;
  38. this.add(middlePanel,c);
  39. }
  40. }