File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ public UI() {
96
96
try {
97
97
ImageIcon image = new ImageIcon ("icons/ste.png" );
98
98
super .setIconImage (image .getImage ());
99
- } // try
99
+ }
100
100
catch (Exception ex ) {
101
101
ex .printStackTrace ();
102
102
}
@@ -132,9 +132,14 @@ public void keyPressed(KeyEvent ke) {
132
132
}
133
133
});
134
134
135
- // This is why we didn't have to worry about the size of the TextArea!
135
+
136
+ JScrollPane scrollPane = new JScrollPane (textArea );
137
+ textArea .setWrapStyleWord (true );
138
+ scrollPane .setVerticalScrollBarPolicy (JScrollPane .VERTICAL_SCROLLBAR_ALWAYS );
136
139
getContentPane ().setLayout (new BorderLayout ()); // the BorderLayout bit makes it fill it automatically
137
- getContentPane ().add (textArea );
140
+ JPanel panel = new JPanel (new BorderLayout ());
141
+ panel .add (scrollPane );
142
+ getContentPane ().add (panel );
138
143
139
144
// Set the Menus
140
145
menuFile = new JMenu ("File" );
You can’t perform that action at this time.
0 commit comments