Skip to content

Commit

Permalink
8277497: Last column cell in the JTAble row is read as empty cell
Browse files Browse the repository at this point in the history
Reviewed-by: ant, kizune, pbansal
  • Loading branch information
savoptik committed Dec 6, 2021
1 parent 5045eb5 commit 70bad89
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/java.desktop/share/classes/javax/swing/JLabel.java
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,10 @@ protected AccessibleJLabel() {}
* @see AccessibleContext#setAccessibleName
*/
public String getAccessibleName() {
return getAccessibleNameCheckIcon(getAccessibleNameImpl());
}

private String getAccessibleNameImpl() {
String name = accessibleName;

if (name == null) {
Expand All @@ -1089,6 +1093,19 @@ public String getAccessibleName() {
return name;
}

private String getAccessibleNameCheckIcon(String name) {
if (((name == null) || name.isEmpty()) &&
(JLabel.this.getIcon() != null)) {
if (JLabel.this.getIcon() instanceof Accessible) {
AccessibleContext ac = ((Accessible) JLabel.this.getIcon()).getAccessibleContext();
if (ac != null) {
name = ac.getAccessibleName();
}
}
}
return name;
}

/**
* Get the role of this object.
*
Expand All @@ -1097,6 +1114,11 @@ public String getAccessibleName() {
* @see AccessibleRole
*/
public AccessibleRole getAccessibleRole() {
String name = getAccessibleNameImpl();
if (((name == null) || name.isEmpty()) &&
(JLabel.this.getIcon() != null)) {
return AccessibleRole.ICON;
}
return AccessibleRole.LABEL;
}

Expand Down

9 comments on commit 70bad89

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

@savoptik
Copy link
Contributor Author

Choose a reason for hiding this comment

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

/backport jbr17u

@openjdk
Copy link

@openjdk openjdk bot commented on 70bad89 Dec 8, 2021

Choose a reason for hiding this comment

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

@savoptik The target repository jbr17u is not a valid target for backports.
List of valid target repositories: openjdk/jdk11u, openjdk/jdk11u-dev, openjdk/jdk12u, openjdk/jdk13u, openjdk/jdk13u-dev, openjdk/jdk14u, openjdk/jdk15u, openjdk/jdk15u-dev, openjdk/jdk16u, openjdk/jdk17u.
Supplying the organization/group prefix is optional.

@savoptik
Copy link
Contributor Author

Choose a reason for hiding this comment

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

/backport jdk17u

@openjdk
Copy link

@openjdk openjdk bot commented on 70bad89 Dec 8, 2021

Choose a reason for hiding this comment

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

@savoptik the backport was successfully created on the branch savoptik-backport-70bad89b in my personal fork of openjdk/jdk17u. To create a pull request with this backport targeting openjdk/jdk17u:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 70bad89b from the openjdk/jdk repository.

The commit being backported was authored by Artem Semenov on 6 Dec 2021 and was reviewed by Anton Tarasov, Alexander Zuev and Pankaj Bansal.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u:

$ git fetch https://github.com/openjdk-bots/jdk17u savoptik-backport-70bad89b:savoptik-backport-70bad89b
$ git checkout savoptik-backport-70bad89b
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u savoptik-backport-70bad89b

@savoptik
Copy link
Contributor Author

Choose a reason for hiding this comment

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

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 70bad89 Dec 23, 2021

Choose a reason for hiding this comment

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

@savoptik the backport was successfully created on the branch savoptik-backport-70bad89b in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 70bad89b from the openjdk/jdk repository.

The commit being backported was authored by Artem Semenov on 6 Dec 2021 and was reviewed by Anton Tarasov, Alexander Zuev and Pankaj Bansal.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev savoptik-backport-70bad89b:savoptik-backport-70bad89b
$ git checkout savoptik-backport-70bad89b
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev savoptik-backport-70bad89b

@earthling-amzn
Copy link
Contributor

Choose a reason for hiding this comment

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

/backport openjdk/jdk11u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 70bad89 Nov 1, 2022

Choose a reason for hiding this comment

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

@earthling-amzn the backport was successfully created on the branch earthling-amzn-backport-70bad89b in my personal fork of openjdk/jdk11u-dev. To create a pull request with this backport targeting openjdk/jdk11u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 70bad89b from the openjdk/jdk repository.

The commit being backported was authored by Artem Semenov on 6 Dec 2021 and was reviewed by Anton Tarasov, Alexander Zuev and Pankaj Bansal.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk11u-dev:

$ git fetch https://github.com/openjdk-bots/jdk11u-dev earthling-amzn-backport-70bad89b:earthling-amzn-backport-70bad89b
$ git checkout earthling-amzn-backport-70bad89b
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk11u-dev earthling-amzn-backport-70bad89b

Please sign in to comment.