Skip to content

Commit 9d287ee

Browse files
committed
CLeanup + remove extra blank lines
1 parent 20698cc commit 9d287ee

File tree

3 files changed

+12
-20
lines changed

3 files changed

+12
-20
lines changed

src/simplejavatexteditor/About.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* @modifiedby Achintha Gunasekara
1515
* @modweb http://www.achinthagunasekara.com
1616
* @modemail [email protected]
17-
*
17+
*
1818
* @Modifiedby SidaDan
1919
* @modemail [email protected]
2020
* Bug fixed. If JTextArea txt not empty and the user will
@@ -42,15 +42,15 @@ public About(UI ui) {
4242
panel = new JPanel(new FlowLayout());
4343
panel.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
4444
frame = new JFrame();
45-
45+
4646
frame.addWindowListener(new WindowAdapter() {
4747
@Override
4848
public void windowClosing(WindowEvent e) {
4949
frame.dispose();
5050
}
5151
});
5252

53-
53+
5454
frame.setVisible(true);
5555
frame.setSize(500,300);
5656
frame.setLocationRelativeTo(ui);

src/simplejavatexteditor/Find.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* @modifiedby Achintha Gunasekara
1515
* @modweb http://www.achinthagunasekara.com
1616
* @modemail [email protected]
17-
*
17+
*
1818
* @Modifiedby SidaDan
1919
* @modemail [email protected]
2020
* Center this JFrame to the JTextArea
@@ -23,7 +23,7 @@
2323
* is only hidden (still running). We need DISPOSE_ON_CLOSE for
2424
* this JFrame.
2525
* Tested with java 8.
26-
*
26+
*
2727
* @Modifiedby SidaDan
2828
* @modemail [email protected]
2929
* Removed unsused imports
@@ -45,7 +45,6 @@ public class Find extends JFrame implements ActionListener {
4545
JButton findBtn, findNext, replace, replaceAll, cancel;
4646
private JTextArea txt;
4747

48-
4948
public Find(JTextArea text) {
5049
this.txt = text;
5150

src/simplejavatexteditor/UI.java

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* @modemail [email protected]
3232
* Removed unuse objects like container, Border emptyBorder
3333
* Removed unsused imports
34-
*
34+
*
3535
* @Modifiedby Giorgos Pasentsis
3636
* @modemail [email protected]
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

Comments
 (0)