Fixed how the community buttons look on macos#171
Merged
matthew-SG merged 1 commit intomainfrom Dec 2, 2025
Merged
Conversation
…order painted methods
Owner
|
Thank you for fixing the button transparency issue for Mac users. |
matthew-SG
approved these changes
Dec 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request updates the styling of several Swing JButton components within the CommunityView to ensure consistent appearance across operating systems, particularly macOS, where Swing's default button rendering differs from Windows. By explicitly configuring button opacity, border painting, focus painting, and preferred sizing, the UI now displays reliably and uniformly on both platforms.
Motivation
Swing buttons on macOS often render with default Aqua-style gradients, borders, and focus indicators even when background colors or sizes are applied. This caused discrepancies in the UI compared to Windows, including:
These changes were introduced to ensure that the community view buttons maintain a consistent visual style across all development environments.
Changes Included
postReviewButton.setPreferredSize(new Dimension(150, 40));
postReviewButton.setBackground(new Color(70, 130, 180));
postReviewButton.setForeground(Color.WHITE);
postReviewButton.setOpaque(true);
postReviewButton.setBorderPainted(false);
postReviewButton.setFocusPainted(false);
refreshReviewButton.setPreferredSize(new Dimension(150, 40));
refreshReviewButton.setBackground(new Color(70, 130, 180));
refreshReviewButton.setForeground(Color.WHITE);
refreshReviewButton.setOpaque(true);
refreshReviewButton.setBorderPainted(false);
refreshReviewButton.setFocusPainted(false);
addButton.setBackground(new Color(60, 179, 113));
addButton.setOpaque(true);
addButton.setBorderPainted(false);
addButton.setForeground(Color.WHITE);
addButton.setPreferredSize(new Dimension(140, 35));
addButton.setFocusPainted(false);
Impact
Improves cross-platform visual consistency of the GUI.
Eliminates reliance on OS-specific default UI rendering.
Provides a uniform, modern, flat-style button appearance across all supported platforms.
No impact on application logic; this PR only modifies presentation properties.
Testing
Changes were verified on both macOS and Windows to confirm that:
Files Modified
CommunityView.java