Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved GUI #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Improved GUI #2

wants to merge 1 commit into from

Conversation

josephAttia
Copy link

So I just changed the Main Menu and just wanted to see if this is what you're looking for.

@nikopetr nikopetr linked an issue Nov 2, 2020 that may be closed by this pull request
Copy link
Owner

@nikopetr nikopetr left a comment

Choose a reason for hiding this comment

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

Thanks for making a pull-request, take a look at the review and make the requested changes after testing and ensuring that everything works well.

JButton standardGameButton = new JButton(Gui.getMessages().getString("standard"));
JButton duelGameButton = new JButton(Gui.getMessages().getString("duel"));
JButton gameInfoButton = new JButton(Gui.getMessages().getString("help"));
//Construct new Components
Copy link
Owner

Choose a reason for hiding this comment

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

You can notice that we use resource bundles instead of typing strings for the names of JLabels and other text field components. The reason we use the resource bundle (e.x. Gui.getMessages().getString("standard") is to use multi-linguar in the program, in other words when a user has the Greek language he/she won't be able to see the text in Greek. So I suggest that you remove any hard coded string you typed and use the strings of the resource bundle. You can check which Strings are available in the bundle in the MessageBundle_en_US.properties file or in any other .properties file.

@@ -1,3 +1,4 @@
import javax.management.StandardEmitterMBean;
Copy link
Owner

Choose a reason for hiding this comment

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

This library is not used anyore in the code (Remove it if you don't need it)

//End


title.setText("<html><font color=black size=45><b>Memory Game</b></html>");
Copy link
Owner

Choose a reason for hiding this comment

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

Don't use HTML code just for one text-label, try and replace this with normal java code

gameInfoButton.setBackground(new Color(59, 89, 182));
gameInfoButton.setForeground(Color.WHITE);
gameInfoButton.setFocusPainted(false);
gameInfoButton.setFont(new Font("Tahoma", Font.BOLD, 12));
Copy link
Owner

Choose a reason for hiding this comment

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

Try and make one Font instance-Object and assign it to the components that use the same Font instead of making new ones each time (ensures code readability)

@@ -44,10 +76,12 @@

GridLayout grid = new GridLayout(2, 0, 10, 20);

gameSelectionPanel.setLayout(grid);
//Added Absolute Positioning
gameSelectionPanel.setLayout(null);
Copy link
Owner

Choose a reason for hiding this comment

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

The whole layout seems that is not justified in the middle. Try and make the layout and text be in the middle of the screen.

image

Also please notice that the screen is now too empty, try and make the components a bit bigger

Copy link
Author

Choose a reason for hiding this comment

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

@nikopetr
This is very weird because when I run it on my side I get this

2020-11-10_10-50-15

Copy link
Owner

Choose a reason for hiding this comment

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

I guess you should test it with different screen sizes as well. Also, make sure to fix the other things mentioned.

@josephAttia josephAttia requested a review from nikopetr November 10, 2020 15:57
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.

Make the score and player panel look better
2 participants