-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8354214: Open source Swing tests Batch 2 #24588
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back jdv! A progress list of the required criteria for merging this PR into |
@jayathirthrao This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 14 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
@jayathirthrao The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
private static CountDownLatch listGainedFocusLatch; | ||
public static void main(String[] args) throws Exception { | ||
try { | ||
listGainedFocusLatch = new CountDownLatch(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it might be better to initialise it directly on line 52?
private static CountDownLatch listGainedFocusLatch = new CountDownLatch(1);
} | ||
}); | ||
|
||
list = new JList(new String[] {"one", "two", "three", "four"}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it might be easier to read if this is initialised on line 49?
private static final JList list = new JList(new String[] {"one", "two", "three", "four"});
and the same for line 69 f = new JFrame("bug4618767");
I feel it is going to be easier to read if global variables were initialised at class level when possible, especially if they are not reassigned further. This way they can also be finalised. But if you feel it's ok as it is, I'm fine with it.
* @bug 4618767 | ||
* @summary First letter navigation in JList interferes with mnemonics | ||
* @key headful | ||
* @run main bug4618767 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: is this line necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM apart from minor suggestion added inline
.title("bug4193267 Instructions") | ||
.instructions(INSTRUCTIONS) | ||
.columns(35) | ||
.testUI(initialize()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PassFailJFrame's .positionTestUI(WindowLayouts::rightOneRow)
can be used to position multiple windows side by side.
private static JFrame f; | ||
private static JList list; | ||
private static boolean menuSelected; | ||
private static boolean failed; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it is accessed on two different threads.
private static boolean failed; | |
private static volatile boolean failed; |
" focus for list"); | ||
} | ||
Robot robot = new Robot(); | ||
robot.setAutoDelay(500); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we reduce autoDelay to a smaller number?
lst.setVisibleRowCount(4); | ||
jsp = new JScrollPane(lst); | ||
fr[0].add(jsp); | ||
fr[0].setSize(400,200); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fr[0].setSize(400,200); | |
fr[0].setSize(400, 200); |
fr[0].setSize(400,200); | ||
|
||
JPanel pL = new JPanel(); | ||
pL.setLayout(new GridLayout(2,1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pL.setLayout(new GridLayout(2,1)); | |
pL.setLayout(new GridLayout(2, 1)); |
pL.add(new JLabel("Last Visible Index")); | ||
|
||
JPanel p = new JPanel(); | ||
p.setLayout(new GridLayout(2,1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p.setLayout(new GridLayout(2,1)); | |
p.setLayout(new GridLayout(2, 1)); |
p.add(last); | ||
|
||
fr[1] = new JFrame("Index"); | ||
fr[1].setSize(200,200); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fr[1].setSize(200,200); | |
fr[1].setSize(200, 200); |
Few swing JList tests are open sourced.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24588/head:pull/24588
$ git checkout pull/24588
Update a local copy of the PR:
$ git checkout pull/24588
$ git pull https://git.openjdk.org/jdk.git pull/24588/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 24588
View PR using the GUI difftool:
$ git pr show -t 24588
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24588.diff
Using Webrev
Link to Webrev Comment