例6.1声明一个面板子类,面板子类对象有3个选择框。

  1. class Panel1 extends JPanel {
  2. JCheckBox box1, box2, box3;
  3.  
  4. Panel1() {
  5. box1 = new JCheckBox("足球");
  6. box2 = new JCheckBox("排球");
  7. box3 = new JCheckBox("篮球");
  8. add(box1);
  9. add(box2);
  10. add(box3);
  11. }
  12. }

例6.2处理选择项目事件的小应用程序。

  1. import java.applet.*;
  2. import javax.swing.*;
  3. import java.awt.*;
  4. import java.awt.event.*;
  5.  
  6. class Panel1 extends JPanel {// 扩展Panel类
  7. JRadioButton box1, box2, box3;
  8. ButtonGroup g;
  9.  
  10. Panel1() {// 3个单选按钮为一组
  11. setLayout(new GridLayout(1, 3));
  12. g = new ButtonGroup();
  13. box1 = new JRadioButton(MyWindow.fName[0] + "计算机", false);
  14. box2 = new JRadioButton(MyWindow.fName[1] + "计算机", false);
  15. box3 = new JRadioButton(MyWindow.fName[2] + "计算机", false);
  16. g.add(box1);
  17. g.add(box2);
  18. g.add(box3);
  19. add(box1);
  20. add(box2);
  21. add(box3);
  22. add(new JLabel("计算机3选1"));
  23. }
  24. }
  25.  
  26. class Panel2 extends JPanel {// 扩展Panel类
  27. JCheckBox box1, box2, box3;
  28. ButtonGroup g;
  29.  
  30. Panel2() {// 3个选择框为一组
  31. setLayout(new GridLayout(1, 3));
  32. g = new ButtonGroup();
  33. box1 = new JCheckBox("购买1台");
  34. box2 = new JCheckBox("购买2台");
  35. box3 = new JCheckBox("购买3台");
  36. g.add(box1);
  37. g.add(box2);
  38. g.add(box3);
  39. add(box1);
  40. add(box2);
  41. add(box3);
  42. add(new JLabel("选择1、2或3"));
  43. }
  44. }
  45.  
  46. class MyWindow extends JFrame implements ItemListener {
  47. Panel1 panel1;
  48. Panel2 panel2;
  49. JLabel label1, label2;
  50. JTextArea text1, text2;
  51. static String fName[] = { "HP", "IBM", "DELL" };// 公司名称表
  52. static double priTbl[][] = { { 1.20, 1.15, 1.10 }, { 1.70, 1.65, 1.60 }, { 1.65, 1.60, 1.58 } };// 产品数量价格对照表
  53. static int production = -1;// 产品标志
  54.  
  55. MyWindow(String s) {
  56. super(s);
  57. Container con = this.getContentPane();
  58. con.setLayout(new GridLayout(3, 2));
  59. this.setLocation(100, 100);
  60. this.setSize(400, 100);
  61. panel1 = new Panel1();
  62. panel2 = new Panel2();
  63. label1 = new JLabel("产品介绍", JLabel.CENTER);
  64. label2 = new JLabel("产品价格", JLabel.CENTER);
  65. text1 = new JTextArea();
  66. text2 = new JTextArea();
  67. con.add(label1);
  68. con.add(label2);
  69. con.add(panel1);
  70. con.add(panel2);
  71. con.add(text1);
  72. con.add(text2);
  73. panel1.box1.addItemListener(this);
  74. panel1.box2.addItemListener(this);
  75. panel1.box3.addItemListener(this);
  76. panel2.box1.addItemListener(this);
  77. panel2.box2.addItemListener(this);
  78. panel2.box3.addItemListener(this);
  79. this.setVisible(true);
  80. this.pack();
  81. }
  82.  
  83. public void itemStateChanged(ItemEvent e) {
  84. if (e.getItemSelectable() == panel1.box1) {
  85. production = 0;
  86. text1.setText(fName[0] + "公司生产");
  87. text2.setText("");
  88. } else if (e.getItemSelectable() == panel1.box2) {
  89. production = 1;
  90. text1.setText(fName[1] + "公司生产");
  91. text2.setText("");
  92. } else if (e.getItemSelectable() == panel1.box3) {
  93. production = 2;
  94. text1.setText(fName[2] + "公司生产");
  95. text2.setText("");
  96. } else {
  97. if (production == -1) {
  98. return;
  99. }
  100. if (e.getItemSelectable() == panel2.box1) {
  101. text2.setText("" + priTbl[production][0] + "万元/台");
  102. } else if (e.getItemSelectable() == panel2.box2) {
  103. text2.setText("" + priTbl[production][1] + "万元/台");
  104. } else if (e.getItemSelectable() == panel2.box3) {
  105. text2.setText("" + priTbl[production][2] + "万元/台");
  106. }
  107. }
  108. }
  109. }
  110.  
  111. public class Example6_2 {
  112. MyWindow myWin = new MyWindow("选择项目处理示例程序");
  113. }

例6.3小应用程序有两个列表,第一个只允许单选,第二个列表允许多选。

  1. import java.applet.*;
  2. import javax.swing.*;
  3. import java.awt.*;
  4. import javax.swing.event.*;
  5.  
  6. class MyWindow extends JFrame implements ListSelectionListener {
  7. JList list1, list2;
  8. String news[] = { "人民日报", "新民晚报", "浙江日报", "文汇报" };
  9. String sports[] = { "足球", "排球", "乒乓球", "篮球" };
  10. JTextArea text;
  11.  
  12. MyWindow(String s) {
  13. super(s);
  14. Container con = getContentPane();
  15. con.setBackground(Color.BLUE);
  16. con.setLayout(new GridLayout(2, 2));
  17. con.setSize(200, 500);
  18. list1 = new JList(news);
  19. list1.setVisibleRowCount(3);
  20. list1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  21. list1.addListSelectionListener(this);
  22. list2 = new JList(sports);
  23. list2.setVisibleRowCount(2);
  24. list2.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  25. list2.addListSelectionListener(this);
  26. con.add(list1);
  27. con.add(list2);
  28. text = new JTextArea(10, 20);
  29. con.add(text);
  30. this.setVisible(true);
  31. this.pack();
  32. }
  33.  
  34. public void valueChanged(ListSelectionEvent e) {
  35. if (e.getSource() == list1) {
  36. text.setText(null);
  37. Object listValue = ((JList) e.getSource()).getSelectedValue();
  38. String seleName = listValue.toString();
  39. for (int i = 0; i < news.length; i++) {
  40. if (news[i].equals(seleName)) {
  41. text.append(seleName + ":被选中\n");
  42. }
  43. }
  44. } else if (e.getSource() == list2) {
  45. text.setText(null);
  46. int tempList[] = list2.getSelectedIndices();// 获得选中索引
  47. for (int i = 0; i < tempList.length; i++) {
  48. text.append(sports[tempList[i]] + ":被选中\n");
  49. }
  50. }
  51. }
  52. }
  53.  
  54. public class Example6_3 extends Applet {
  55. MyWindow myWin = new MyWindow("列表示例");
  56. }

例6.4一个说明组合框用法的应用程序。

  1. import javax.swing.*;
  2. import java.awt.*;
  3. import java.awt.event.*;
  4.  
  5. public class Example6_4 {
  6. public static void main(String[] args) {
  7. ComboBoxDemo myComboBoxGUI = new ComboBoxDemo();
  8. }
  9. }
  10.  
  11. class ComboBoxDemo extends JFrame implements ActionListener, ItemListener {
  12. public static final int Width = 350;
  13. public static final int Height = 150;
  14. String proList[] = { "踢足球", "打篮球", "打排球" };
  15. JTextField text;
  16. JComboBox comboBox;
  17.  
  18. public ComboBoxDemo() {
  19. setSize(Width, Height);
  20. setTitle("组合框使用示意程序");
  21. Container conPane = getContentPane();
  22. conPane.setBackground(Color.BLUE);
  23. conPane.setLayout(new FlowLayout());
  24. comboBox = new JComboBox(proList);
  25. comboBox.addActionListener(this);
  26. comboBox.addItemListener(this);
  27. comboBox.setEditable(true);
  28. conPane.add(comboBox);
  29. text = new JTextField(10);
  30. conPane.add(text);
  31. this.setVisible(true);
  32. }
  33.  
  34. public void actionPerformed(ActionEvent e) {
  35. if (e.getSource() == comboBox) {
  36. text.setText(comboBox.getSelectedItem().toString());
  37. }
  38. }
  39.  
  40. public void itemStateChanged(ItemEvent e) {
  41. if (e.getSource() == comboBox) {
  42. text.setText(comboBox.getSelectedItem().toString());
  43. }
  44. }
  45. }

例6.5小应用程序示意窗口有菜单条的实现方法。

  1. import java.applet.*;
  2. import javax.swing.*;
  3. import java.awt.*;
  4. import java.awt.event.*;
  5.  
  6. class MenuWindow extends JFrame implements ActionListener {
  7. public static JTextField text;
  8.  
  9. private void addItem(JMenu menu, String menuName, ActionListener listener) {
  10. JMenuItem anItem = new JMenuItem(menuName);
  11. anItem.setActionCommand(menuName);
  12. anItem.addActionListener(listener);
  13. menu.add(anItem);
  14. }
  15.  
  16. public MenuWindow(String s, int w, int h) {
  17. setTitle(s);
  18. Container con = this.getContentPane();
  19. con.setLocation(100, 100);
  20. this.setSize(w, h);
  21. JMenu menu1 = new JMenu("体育");
  22. addItem(menu1, "跑步", this);
  23. addItem(menu1, "跳绳", this);
  24. addItem(menu1, "打球", this);
  25. JMenu menu2 = new JMenu("娱乐");
  26. addItem(menu2, "唱歌", this);
  27. addItem(menu2, "跳舞", this);
  28. addItem(menu2, "游戏", this);
  29. JMenuBar menubar = new JMenuBar();
  30. text = new JTextField();
  31. menubar.add(menu1);
  32. menubar.add(menu2);
  33. setJMenuBar(menubar);
  34. con.add(text, BorderLayout.NORTH);
  35. }
  36.  
  37. public void actionPerformed(ActionEvent e) {
  38. text.setText(e.getActionCommand() + "菜单项被选中!");
  39. }
  40. }
  41.  
  42. public class Example6_5 extends Applet implements ActionListener {
  43.  
  44. MenuWindow window;
  45. JButton button;
  46. boolean bflg;
  47.  
  48. public void init() {
  49. button = new JButton("打开我的体育娱乐之窗");
  50. bflg = true;
  51. window = new MenuWindow("体育娱乐之窗", 100, 100);
  52. button.addActionListener(this);
  53. add(button);
  54. }
  55.  
  56. public void actionPerformed(ActionEvent e) {
  57. if (e.getSource() == button) {
  58. if (bflg) {
  59. window.setVisible(true);
  60. bflg = false;
  61. button.setLabel("关闭我的体育娱乐之窗");
  62. } else {
  63. window.setVisible(false);
  64. bflg = true;
  65. button.setLabel("打开我的体育娱乐之窗");
  66. }
  67. }
  68. }
  69. }

例6.6小应用程序声明一个用户窗口类和对话框类,用户窗口有两个按钮和两个文本框,当点击某个按钮时,对应的对话框被激活。

  1. import java.applet.*;
  2. import javax.swing.*;
  3. import java.awt.*;
  4. import java.awt.event.*;
  5.  
  6. class MyWindow extends JFrame implements ActionListener {
  7. private JButton button1, button2;
  8. private static int flg = 0;
  9. private static JTextField text1, text2;
  10.  
  11. MyWindow(String s)// 窗口内有两个按钮
  12. {
  13. super(s);
  14. Container con = this.getContentPane();
  15. con.setLayout(new GridLayout(2, 2));
  16. this.setSize(200, 100);
  17. this.setLocation(100, 100);
  18. button1 = new JButton("选择水果");
  19. button2 = new JButton("选择食品");
  20. button1.addActionListener(this);
  21. button2.addActionListener(this);
  22. text1 = new JTextField(20);
  23. text2 = new JTextField(20);
  24. con.add(button1);
  25. con.add(button2);
  26. con.add(text1);
  27. con.add(text2);
  28. this.setVisible(true);
  29. this.pack();
  30. }
  31.  
  32. public static void returnName(String s) {
  33. if (flg == 1) {
  34. text1.setText("选择的水果是:" + s);
  35. } else if (flg == 2) {
  36. text2.setText("选择的食品是:" + s);
  37. }
  38. }
  39.  
  40. public void actionPerformed(ActionEvent e) {
  41. MyDialog dialog;
  42. if (e.getSource() == button1) {
  43. dialog = new MyDialog(this, "水果");
  44. dialog.setVisible(true);
  45. flg = 1;
  46. } else if (e.getSource() == button2) {
  47. dialog = new MyDialog(this, "食品");
  48. dialog.setVisible(true);
  49. flg = 2;
  50. }
  51. }
  52. }
  53.  
  54. class MyDialog extends JDialog implements ActionListener {
  55. JLabel title;
  56. JTextField text;
  57. JButton done;
  58.  
  59. MyDialog(JFrame F, String s) {
  60. super(F, s, true);
  61. Container con = this.getContentPane();
  62. title = new JLabel("输入" + s + "名称");
  63. text = new JTextField(10);
  64. text.setEditable(true);
  65. con.setLayout(new FlowLayout());
  66. con.setSize(200, 100);
  67. setModal(false);
  68. done = new JButton("确定");
  69. done.addActionListener(this);
  70. con.add(title);
  71. con.add(text);
  72. con.add(done);
  73. con.setVisible(true);
  74. this.pack();
  75. }
  76.  
  77. public void actionPerformed(ActionEvent e) {
  78. MyWindow.returnName(text.getText());
  79. setVisible(false);
  80. dispose();
  81. }
  82. }
  83.  
  84. public class Example6_6 extends Applet {
  85. MyWindow window;
  86. MyDialog diaglog;
  87.  
  88. public void init()// 程序的主窗口暂没有组件
  89. {
  90. window = new MyWindow("带对话框窗口");// 创建一个窗口
  91. }
  92. }

例6.7应用程序将滚动条作为值的选择。

  1. import javax.swing.*;
  2. import java.awt.*;
  3. import java.awt.event.*;
  4.  
  5. class MyScrollBar extends JScrollBar {
  6. public MyScrollBar(int init, int len, int low, int high) {
  7. super(JScrollBar.HORIZONTAL, init, len, low, high);
  8. }
  9.  
  10. public Dimension getPreferredSize() {
  11. return new Dimension(125, 20);
  12. }
  13. }
  14.  
  15. class MyWindow extends JFrame implements ActionListener, AdjustmentListener {
  16. private JButton button;
  17. private JTextField text;
  18. private boolean barOpened;
  19.  
  20. MyWindow(String s) {
  21. super(s);
  22. MyScrollBar tempBar = new MyScrollBar(10, 10, 0, 255);
  23. Container con = this.getContentPane();
  24. con.setLayout(new GridLayout(2, 1));
  25. this.setSize(200, 100);
  26. this.setLocation(100, 100);
  27. button = new JButton("开/闭滚动条");
  28. button.addActionListener(this);
  29. barOpened = false;
  30. tempBar.addAdjustmentListener(this);
  31. text = new JTextField("滚动条关闭", 20);
  32. con.add(button);
  33. con.add(text);
  34. con.add(tempBar);
  35. this.setVisible(true);
  36. this.pack();
  37. }
  38.  
  39. public void actionPerformed(ActionEvent e) {
  40. if (e.getSource() == button) {
  41. if (barOpened) {
  42. text.setText("滚动条关闭");
  43. } else {
  44. text.setText("滚动条打开");
  45. }
  46. barOpened = !barOpened;
  47. }
  48. }
  49.  
  50. public void adjustmentValueChanged(AdjustmentEvent e) {
  51. if (barOpened) {
  52. MyScrollBar myBar = (MyScrollBar) e.getAdjustable();
  53. text.setText("选择的值是:" + myBar.getValue());
  54. }
  55. }
  56. }
  57.  
  58. public class Example6_7 {
  59. public static void main(String[] args) {
  60. MyWindow myWindow = new MyWindow("滚动条实例");
  61. }
  62. }

例6.8小应用程序设置了一个文本区,用于记录一系列鼠标事件。

  1. import java.applet.*;
  2. import java.awt.*;
  3. import javax.swing.*;
  4. import java.awt.event.*;
  5.  
  6. class MyPanel extends JPanel {
  7. public void print(int r) {
  8. Graphics g = getGraphics();// 获得系统给予小应用程序的图形对象
  9. g.clearRect(0, 0, this.getWidth(), this.getHeight());
  10. g.setColor(Color.red);
  11. g.fillOval(10, 10, r, r);// 用红色填充一个圆块
  12. }
  13. }
  14.  
  15. class MyWindow extends JFrame implements MouseListener {
  16. JTextArea text;
  17. MyPanel panel;
  18. int x, y, r = 10;
  19. int mouseFlg = 0;
  20. static String mouseStates[] = { "鼠标键按下", "鼠标松开", "鼠标进来", "鼠标走开", "鼠标双击" };
  21.  
  22. MyWindow(String s) {
  23. super(s);
  24. Container con = this.getContentPane();
  25. con.setLayout(new GridLayout(2, 1));
  26. this.setSize(200, 300);
  27. this.setLocation(100, 100);
  28. panel = new MyPanel();
  29. con.add(panel);
  30. text = new JTextArea(10, 20);
  31. text.setBackground(Color.blue);
  32. con.add(text);
  33. addMouseListener(this);
  34. this.setVisible(true);
  35. this.pack();
  36. }
  37.  
  38. public void paint(Graphics g) {
  39. r = r + 4;
  40. if (r > 80) {
  41. r = 10;
  42. }
  43. text.append(mouseStates[mouseFlg] + "了,位置是:" + x + "," + y + "\n");
  44. panel.print(r);
  45. }
  46.  
  47. public void mousePressed(MouseEvent e) {
  48. x = e.getX();
  49. y = e.getY();
  50. mouseFlg = 0;
  51. repaint();
  52. }
  53.  
  54. public void mouseReleased(MouseEvent e) {
  55. x = e.getX();
  56. y = e.getY();
  57. mouseFlg = 1;
  58. repaint();
  59. }
  60.  
  61. public void mouseEntered(MouseEvent e) {
  62. x = e.getX();
  63. y = e.getY();
  64. mouseFlg = 2;
  65. repaint();
  66. }
  67.  
  68. public void mouseExited(MouseEvent e) {
  69. x = e.getX();
  70. y = e.getY();
  71. mouseFlg = 3;
  72. repaint();
  73. }
  74.  
  75. public void mouseClicked(MouseEvent e) {
  76. if (e.getClickCount() == 2) {
  77. x = e.getX();
  78. y = e.getY();
  79. mouseFlg = 4;
  80. repaint();
  81. } else {
  82.  
  83. }
  84. }
  85. }
  86.  
  87. public class Example6_8 extends Applet {
  88. public void init() {
  89. MyWindow myWindow = new MyWindow("鼠标事件示意程序");
  90. }
  91. }

例6.9一个滚动条与显示窗口同步变化的应用程序。

  1. import java.awt.*;
  2. import javax.swing.*;
  3. import java.awt.event.*;
  4.  
  5. class MyWindow extends JFrame {
  6. public MyWindow(String s) {
  7. super(s);
  8. Container con = this.getContentPane();
  9. con.setLayout(new GridLayout());
  10. this.setLocation(100, 100);
  11. JScrollBar xAxis = new JScrollBar(JScrollBar.HORIZONTAL, 50, 1, 0, 100);
  12. JScrollBar yAxis = new JScrollBar(JScrollBar.VERTICAL, 50, 1, 0, 100);
  13. MyListener listener = new MyListener(xAxis, yAxis, 238, 118);
  14. JPanel scrolledCanvas = new JPanel();
  15. scrolledCanvas.setLayout(new BorderLayout());
  16. scrolledCanvas.add(listener, BorderLayout.CENTER);
  17. scrolledCanvas.add(xAxis, BorderLayout.SOUTH);
  18. scrolledCanvas.add(yAxis, BorderLayout.EAST);
  19. con.add(scrolledCanvas, BorderLayout.CENTER);
  20. this.setVisible(true);
  21. this.pack();
  22. }
  23.  
  24. public Dimension getPreferredSize() {
  25. return new Dimension(500, 300);
  26. }
  27. }
  28.  
  29. class MyListener extends JComponent implements MouseListener, MouseMotionListener, AdjustmentListener {
  30. private int x, y;
  31. private JScrollBar xScrollBar;
  32. private JScrollBar yScrollBar;
  33.  
  34. private void updateScrollBars(int x, int y) {
  35. int d;
  36. d = (int) (((float) x / (float) getSize().width) * 100.0);
  37. xScrollBar.setValue(d);
  38. d = (int) (((float) y / (float) getSize().height) * 100.0);
  39. yScrollBar.setValue(d);
  40. }
  41.  
  42. public MyListener(JScrollBar xaxis, JScrollBar yaxis, int x0, int y0) {
  43. xScrollBar = xaxis;
  44. yScrollBar = yaxis;
  45. x = x0;
  46. y = y0;
  47. xScrollBar.addAdjustmentListener(this);
  48. yScrollBar.addAdjustmentListener(this);
  49. this.addMouseListener(this);// 监视鼠标点击事件
  50. this.addMouseMotionListener(this);// 监视鼠标拖动事件
  51. }
  52.  
  53. public void paint(Graphics g) {
  54. g.setColor(getBackground());
  55. Dimension size = getSize();
  56. g.fillRect(0, 0, size.width, size.height);
  57. g.setColor(Color.blue);
  58. g.fillRect(x, y, 50, 50);
  59. }
  60.  
  61. public void mouseEntered(MouseEvent e) {
  62.  
  63. }
  64.  
  65. public void mouseExited(MouseEvent e) {
  66.  
  67. }
  68.  
  69. public void mouseClicked(MouseEvent e) {
  70.  
  71. }
  72.  
  73. public void mouseReleased(MouseEvent e) {
  74.  
  75. }
  76.  
  77. public void mouseMoved(MouseEvent e) {
  78.  
  79. }
  80.  
  81. public void mousePressed(MouseEvent e) {
  82. x = e.getX();
  83. y = e.getY();
  84. updateScrollBars(x, y);
  85. repaint();
  86. }
  87.  
  88. public void mouseDragged(MouseEvent e) {
  89. x = e.getX();
  90. y = e.getY();
  91. updateScrollBars(x, y);
  92. repaint();
  93. }
  94.  
  95. public void adjustmentValueChanged(AdjustmentEvent e) {
  96. if (e.getSource() == xScrollBar) {
  97. x = (int) ((float) (xScrollBar.getValue() / 100.0) * getSize().width);
  98. } else if (e.getSource() == yScrollBar) {
  99. y = (int) ((float) (yScrollBar.getValue() / 100.0) * getSize().height);
  100. }
  101. repaint();
  102. }
  103. }
  104.  
  105. public class Example6_9 {
  106. public static void main(String[] args) {
  107. MyWindow myWindow = new MyWindow("滚动条示意程序");
  108. }
  109. }

例6.10小应用程序有一个按钮和一个文本区,按钮作为发生键盘事件的事件源,并对它实施监视。

  1. import java.applet.*;
  2. import java.awt.*;
  3. import java.awt.event.*;
  4.  
  5. public class Example6_10 extends Applet implements KeyListener {
  6. int count = 0;
  7. Button button = new Button();
  8. TextArea text = new TextArea(5, 20);
  9.  
  10. public void init() {
  11. button.addKeyListener(this);
  12. add(button);
  13. add(text);
  14. }
  15.  
  16. public void keyPressed(KeyEvent e) {
  17. int t = e.getKeyCode();
  18. if (t >= KeyEvent.VK_A && t <= KeyEvent.VK_Z) {
  19. text.append((char) t + " ");
  20. count++;
  21. if (count % 10 == 0) {
  22. text.append("\n");
  23. }
  24. }
  25. }
  26.  
  27. public void keyTyped(KeyEvent e) {
  28.  
  29. }
  30.  
  31. public void keyReleased(KeyEvent e) {
  32.  
  33. }
  34. }

04747_Java语言程序设计(一)_第6章_图形界面设计(二)的更多相关文章

  1. ArcGIS for Desktop入门教程_第七章_使用ArcGIS进行空间分析 - ArcGIS知乎-新一代ArcGIS问答社区

    原文:ArcGIS for Desktop入门教程_第七章_使用ArcGIS进行空间分析 - ArcGIS知乎-新一代ArcGIS问答社区 1 使用ArcGIS进行空间分析 1.1 GIS分析基础 G ...

  2. ArcGIS for Desktop入门教程_第六章_用ArcMap制作地图 - ArcGIS知乎-新一代ArcGIS问答社区

    原文:ArcGIS for Desktop入门教程_第六章_用ArcMap制作地图 - ArcGIS知乎-新一代ArcGIS问答社区 1 用ArcMap制作地图 作为ArcGIS for Deskto ...

  3. ArcGIS for Desktop入门教程_第四章_入门案例分析 - ArcGIS知乎-新一代ArcGIS问答社区

    原文:ArcGIS for Desktop入门教程_第四章_入门案例分析 - ArcGIS知乎-新一代ArcGIS问答社区 1 入门案例分析 在第一章里,我们已经对ArcGIS系列软件的体系结构有了一 ...

  4. python 教程 第十九章、 图形界面编程

    第十九章. 图形界面编程 import Tkinter top = Tkinter.Tk() hello = Tkinter.Label(top, text='Hello World!') hello ...

  5. 04747_Java语言程序设计(一)_第3章_面向对象编程基础

    链式编程 每次调用方法后,返回的是一个对象 /* * 链式编程 * 每次调用方法后,返回的是一个对象 */ class Student { public void study() { System.o ...

  6. 04747_Java语言程序设计(一)_第1章_Java语言基础

    二进制0b开头 八进制0开头 十六进制0x开头 package com.jacky; public class Aserver { public static void main(String arg ...

  7. 04747_Java语言程序设计(一)_第10章_网络与数据库编程基础

    例10.1说明InetAddress类的用法的应用程序. public class Example10_1 { public static void main(String args[]) { try ...

  8. 04747_Java语言程序设计(一)_第9章_输入和输出流

    例9.1一个文件复制应用程序,将某个文件的内容全部复制到另一个文件. import java.io.*; public class Example9_1 { public static void ma ...

  9. 04747_Java语言程序设计(一)_第8章_多线程

    例8.1应用程序用Thread子类实现多线程. import java.util.Date; public class Example8_1 { static Athread threadA; sta ...

  10. 04747_Java语言程序设计(一)_第7章_图形、图像与多媒体

    例7.1小应用程序用6种字型显示字符串,显示内容说明本身的字型. import java.applet.*; import java.awt.*; public class Example7_1 ex ...

随机推荐

  1. 马士兵 Servlet & JSP(1) Servlet (源代码)

    1.HTTP协议基础测试(获取页面源代码) import java.io.BufferedReader; import java.io.IOException; import java.io.Inpu ...

  2. C# 约瑟夫环算法

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...

  3. 【CSS3】横屏引导小动画

    演示地址:http://codepen.io/anon/pen/oXbXdX 主要知识点: @media all and (orientation : landscape) { /* 这是匹配横屏的状 ...

  4. 浏览器内核Trident/Gecko/WebKit/Presto

    “浏览器内核”主要指渲染引擎(Rendering Engine),负责解析网页语法(如HTML.JavaScript)并渲染.展示网页.因此,所谓的浏览器内核通常也就是指浏览器所采用的渲染引擎, 渲染 ...

  5. [Regex Expression] Use Shorthand to Find Common Sets of Characters

    In this lesson we'll learn shorthands for common character classes as well as their negated forms. v ...

  6. WAS集群系列(6):集群搭建:步骤4:安装WAS升级软件

    逐步点击"下一步",注意一处流程,例如以下列举: "升级软件"安装的路径设置,建议与之前的WAS及IHS安装的绝对路径同样,例如以下所看到的: 逐步点击,完毕安 ...

  7. c++11 线程:让你的多线程任务更轻松

      介绍 本文旨在帮助有经验的Win32程序员来了解c++ 11线程库及同步对象 和 Win32线程及同步对象之间的区别和相似之处. 在Win32中,所有的同步对象句柄(HANDLE)是全局句柄.它们 ...

  8. Canvas制作排序算法演示动画

    tips: 形象化演示排序算法可以让初学者快速理解,比较好的例子:jun-lu的SortAnimate,旧金山大学的David Galles教授的算法演示课件.最近在看canvas,试着用js+can ...

  9. Sass函数--颜色函数--RGB颜色函数

    RGB颜色函数-RGB()颜色函数 主要分为 RGB , HSL 和 Opacity 三大函数,当然其还包括一些其他的颜色函数,比如说 adjust-color 和 change-color 等.1. ...

  10. jdbc oracle 连接字符串

    1.普通SID方式 jdbc:oracle:thin:username/password@x.x.x.1:1521:SID 2.普通ServerName方式 jdbc:Oracle:thin:user ...