Skip to content

Commit

Permalink
7124527: [macosx] SwingSet2, label is not read by VoiceOver when focu…
Browse files Browse the repository at this point in the history
…s is on textfield for Internalframe and Table demo.

Reviewed-by: asemenov, serb
  • Loading branch information
Abhishek Kumar committed Apr 5, 2023
1 parent ed9592c commit 0ec3d2e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/demo/share/jfc/SwingSet2/InternalFrameDemo.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2023, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -271,6 +271,7 @@ public Insets getInsets() {

windowTitleField = new JTextField(getString("InternalFrameDemo.frame_label"));
windowTitleLabel = new JLabel(getString("InternalFrameDemo.title_text_field_label"));
windowTitleLabel.setLabelFor(windowTitleField);

p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
p.add(Box.createRigidArea(HGAP5));
Expand Down
7 changes: 6 additions & 1 deletion src/demo/share/jfc/SwingSet2/TableDemo.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2023, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -281,6 +281,7 @@ public Dimension getMaximumSize() {
selectionModeComboBox.addItem(getString("TableDemo.one_range"));
selectionModeComboBox.addItem(getString("TableDemo.multiple_ranges"));
selectionModeComboBox.setSelectedIndex(tableView.getSelectionModel().getSelectionMode());
selectionModeComboBox.getAccessibleContext().setAccessibleName(getString("TableDemo.selection_mode"));
selectionModeComboBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
JComboBox<?> source = (JComboBox<?>)e.getSource();
Expand Down Expand Up @@ -310,6 +311,7 @@ public Dimension getMaximumSize() {
resizeModeComboBox.addItem(getString("TableDemo.last_column"));
resizeModeComboBox.addItem(getString("TableDemo.all_columns"));
resizeModeComboBox.setSelectedIndex(tableView.getAutoResizeMode());
resizeModeComboBox.getAccessibleContext().setAccessibleName(getString("TableDemo.autoresize_mode"));
resizeModeComboBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
JComboBox<?> source = (JComboBox<?>)e.getSource();
Expand All @@ -330,6 +332,9 @@ public void itemStateChanged(ItemEvent e) {
footerTextField = new JTextField(getString("TableDemo.footerText"), 15);
fitWidth = new JCheckBox(getString("TableDemo.fitWidth"), true);
printButton = new JButton(getString("TableDemo.print"));

headerLabel.setLabelFor(headerTextField);
footerLabel.setLabelFor(footerTextField);
printButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
printTable();
Expand Down

1 comment on commit 0ec3d2e

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.