3131 * @modemail Fschultz@sinf.de
3232 * Removed unuse objects like container, Border emptyBorder
3333 * Removed unsused imports
34- *
34+ *
3535 * @Modifiedby Giorgos Pasentsis
3636 * @modemail gpasents@gmail.com
3737 */
@@ -61,11 +61,10 @@ public class UI extends JFrame implements ActionListener {
6161 JButton newButton , openButton , saveButton , clearButton , quickButton , aboutMeButton , aboutButton , closeButton , boldButton , italicButton ;
6262 private final Action selectAllAction ;
6363
64-
6564 //setup icons - Bold and Italic
6665 private final ImageIcon boldIcon = new ImageIcon ("icons/bold.png" );
6766 private final ImageIcon italicIcon = new ImageIcon ("icons/italic.png" );
68-
67+
6968 // setup icons - File Menu
7069 private final ImageIcon newIcon = new ImageIcon ("icons/new.png" );
7170 private final ImageIcon openIcon = new ImageIcon ("icons/open.png" );
@@ -94,7 +93,6 @@ public class UI extends JFrame implements ActionListener {
9493 private boolean edit = false ;
9594
9695 public UI () {
97-
9896 // Set the initial size of the window
9997 setSize (800 , 500 );
10098
@@ -319,13 +317,13 @@ public void actionPerformed(ActionEvent ev) {
319317 closeButton .addActionListener (this );
320318 mainToolbar .add (closeButton );
321319 mainToolbar .addSeparator ();
322-
320+
323321 boldButton = new JButton (boldIcon );
324322 boldButton .setToolTipText ("Bold" );
325323 boldButton .addActionListener (this );
326324 mainToolbar .add (boldButton );
327325 mainToolbar .addSeparator ();
328-
326+
329327 italicButton = new JButton (italicIcon );
330328 italicButton .setToolTipText ("Italic" );
331329 italicButton .addActionListener (this );
@@ -380,7 +378,6 @@ public void actionPerformed(ActionEvent ev) {
380378
381379 Font font1 = new Font (fontFamily , Font .PLAIN , sizeOfFont );
382380 textArea .setFont (font1 );
383-
384381 }
385382 });
386383 //FONT SIZE SETTINGS SECTION END
@@ -508,18 +505,14 @@ else if (e.getSource() == saveFile || e.getSource() == saveButton) {
508505 else if (e .getSource () == boldButton ) {
509506 if (textArea .getFont ().getStyle () == Font .BOLD ){
510507 textArea .setFont (textArea .getFont ().deriveFont (Font .PLAIN ));
511-
512- }
513- else {
508+ } else {
514509 textArea .setFont (textArea .getFont ().deriveFont (Font .BOLD ));
515510 }
516511 }// If the source of the event was the "Italic" button
517512 else if (e .getSource () == italicButton ) {
518513 if (textArea .getFont ().getStyle () == Font .ITALIC ){
519514 textArea .setFont (textArea .getFont ().deriveFont (Font .PLAIN ));
520-
521- }
522- else {
515+ } else {
523516 textArea .setFont (textArea .getFont ().deriveFont (Font .ITALIC ));
524517 }
525518 }
@@ -543,7 +536,6 @@ else if (e.getSource() == aboutMe || e.getSource() == aboutMeButton) {
543536 else if (e .getSource () == aboutSoftware || e .getSource () == aboutButton ) {
544537 new About (this ).software ();
545538 }
546-
547539 }
548540
549541 class SelectAllAction extends AbstractAction {
@@ -591,4 +583,5 @@ private void saveFile() {
591583 }
592584 }
593585 }
586+
594587}
0 commit comments