June 2017
Beginner
1296 pages
69h 23m
English
... ); 56 setSize(400, 300); // set size of window
57 setVisible(true); // show window
58 }
59
60 // load document
61 private void getThePage(String location)
62 {
63 try // load document and display location
64 {
65 contentsArea.setPage(location); // set the page
66 enterField.setText(location); // set the text
67 }
68 catch (IOException ioException)
69 {
70 JOptionPane.showMessageDialog(this,
71 “Error retrieving specified URL”, “Bad URL”,
72 JOptionPane.ERROR_MESSAGE);
73 }
74 }
75 }
ReadServerFile.
1 // Fig. 28.2: ReadServerFileTest.java
2 // Create and start a ReadServerFile.
3 import javax.swing.JFrame;
4
5 public class ReadServerFileTest
6 {
7 public static void main(String[] args)
8 {
9 ReadServerFile application ...