moneyTable.java
上传用户:qzpk678
上传日期:2021-04-29
资源大小:10k
文件大小:2k
源码类别:

家庭/个人应用

开发平台:

Java

  1. package src;
  2. import java.awt.*;
  3. import java.awt.event.ActionEvent;
  4. import java.awt.event.ActionListener;
  5. import javax.swing.*;
  6. public class moneyTable extends JFrame
  7. {
  8. private static final long serialVersionUID = 1L;
  9. JLabel jl1,jl2;
  10. JButton jb1,jb2;
  11. Font font=new Font("Monospaced" ,Font.BOLD,20);
  12. Box b1,b2,b;
  13. moneyTable(String s)
  14. {
  15. setTitle(s);
  16. jl1=new JLabel("收入项填写--> "); 
  17. jl1.setForeground(Color.magenta);
  18. jl1.setFont(font);
  19. jl1.setHorizontalAlignment(JLabel.CENTER); 
  20. jl2=new JLabel("支出项填写--> "); 
  21. jl2.setForeground(Color.magenta);
  22. jl2.setFont(font);
  23. jl2.setHorizontalAlignment(JLabel.CENTER); 
  24. jb1=new JButton("Go");
  25. jb1.addActionListener(new ActionListener(){
  26. public void actionPerformed(ActionEvent e){
  27. new in("收入项明细");
  28. }
  29. });
  30. jb2=new JButton("Go");
  31. jb2.addActionListener(new ActionListener(){
  32. public void actionPerformed(ActionEvent e){
  33. new out("支出项明细");
  34. }
  35. });
  36. b1=Box.createVerticalBox();
  37. b1.add(Box.createVerticalStrut(20));
  38. b1.add(jl1);
  39. b1.add(Box.createVerticalStrut(8));
  40. b1.add(jl2);
  41. b2=Box.createVerticalBox();
  42. b2.add(Box.createVerticalStrut(15));
  43. b2.add(jb1);
  44. b2.add(Box.createVerticalStrut(8));
  45. b2.add(jb2);
  46. b=Box.createHorizontalBox();
  47. b.add(b1);
  48. b.add(Box.createHorizontalStrut(2));
  49. b.add(b2);
  50. add(b);
  51. setLayout(new FlowLayout());
  52. validate();
  53. setResizable(false);
  54. setBounds(500, 300, 350, 150);
  55. setVisible(true);
  56. setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  57. }
  58. }