Skip to content

Added Bold and Italic buttons - #24

Merged
pH-7 merged 5 commits into
pH-7:masterfrom
gpasents:master
Feb 5, 2018
Merged

Added Bold and Italic buttons#24
pH-7 merged 5 commits into
pH-7:masterfrom
gpasents:master

Conversation

@gpasents

@gpasents gpasents commented Feb 4, 2018

Copy link
Copy Markdown
Contributor

Added the buttons and images for bold and italic options for fonts

Comment thread src/simplejavatexteditor/UI.java Outdated

}
else{

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra line here ;)

Comment thread src/simplejavatexteditor/UI.java Outdated

}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra spaces here

else if (e.getSource() == italicButton) {
if(textArea.getFont().getStyle() == Font.ITALIC){
textArea.setFont(textArea.getFont().deriveFont(Font.PLAIN));

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra line here

Comment thread src/simplejavatexteditor/UI.java Outdated

}
else{

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra line here

else if (e.getSource() == boldButton) {
if(textArea.getFont().getStyle() == Font.BOLD){
textArea.setFont(textArea.getFont().deriveFont(Font.PLAIN));

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra line here

Comment thread src/simplejavatexteditor/UI.java Outdated
saveFile();
}// If the source of the event was the "Bold" button
else if (e.getSource() == boldButton) {
if(textArea.getFont().getStyle() == Font.BOLD){

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a space after if to be if (textArea.getFont()

Comment thread src/simplejavatexteditor/UI.java Outdated

textArea.setFont(textArea.getFont().deriveFont(Font.BOLD));
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra line here

Comment thread src/simplejavatexteditor/UI.java Outdated

textArea.setFont(textArea.getFont().deriveFont(Font.ITALIC));
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary extra line here


// Set the initial size of the window
setSize(700, 500);
setSize(800, 500);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why you change the size..? Didn't it fit with the changes..?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new buttons make the font size area dissapear, so i increased the window's size

@pH-7

pH-7 commented Feb 4, 2018

Copy link
Copy Markdown
Owner

Hi @gpasents

Thanks a lot for contributing! Highly appreciate! 😃

Please see my reviews.

Comment thread src/simplejavatexteditor/UI.java Outdated
aboutMe, aboutSoftware, wordWrap;
private final JToolBar mainToolbar;
JButton newButton, openButton, saveButton, clearButton, quickButton, aboutMeButton, aboutButton, closeButton;
JButton newButton, openButton, saveButton, clearButton, quickButton, aboutMeButton, aboutButton, closeButton,boldButton,italicButton;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a space after the comma to be as closeButton, boldButton, italicButton;

@pH-7
pH-7 merged commit 20698cc into pH-7:master Feb 5, 2018

@pH-7 pH-7 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@pH-7

pH-7 commented Feb 5, 2018

Copy link
Copy Markdown
Owner

Great! Thanks alot @gpasents and see you hopefully another time. Take care! 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants