8378204: Remove AppContext from two Swing UI classes

Reviewed-by: serb, kizune
This commit is contained in:
Phil Race 2026-02-19 17:58:36 +00:00
parent 82fe8b9cd0
commit 9b44ea39bf
3 changed files with 3 additions and 14 deletions

View File

@ -36,8 +36,6 @@ import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicRadioButtonUI;
import sun.awt.AppContext;
/**
* RadioButtonUI implementation for MotifRadioButtonUI
*
@ -45,7 +43,7 @@ import sun.awt.AppContext;
*/
public class MotifRadioButtonUI extends BasicRadioButtonUI {
private static final Object MOTIF_RADIO_BUTTON_UI_KEY = new Object();
private static final ComponentUI UI = new MotifRadioButtonUI();
protected Color focusColor;
@ -55,14 +53,7 @@ public class MotifRadioButtonUI extends BasicRadioButtonUI {
// Create PLAF
// ********************************
public static ComponentUI createUI(JComponent c) {
AppContext appContext = AppContext.getAppContext();
MotifRadioButtonUI motifRadioButtonUI =
(MotifRadioButtonUI) appContext.get(MOTIF_RADIO_BUTTON_UI_KEY);
if (motifRadioButtonUI == null) {
motifRadioButtonUI = new MotifRadioButtonUI();
appContext.put(MOTIF_RADIO_BUTTON_UI_KEY, motifRadioButtonUI);
}
return motifRadioButtonUI;
return UI;
}
// ********************************

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -26,7 +26,6 @@
package javax.swing.plaf.metal;
import sun.swing.SwingUtilities2;
import sun.awt.AppContext;
import javax.swing.*;
import javax.swing.plaf.*;

View File

@ -35,7 +35,6 @@ import java.awt.PopupMenu;
import java.awt.Menu;
import java.awt.MenuItem;
import java.awt.Toolkit;
import sun.awt.AppContext;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.InvocationEvent;