Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Internal API Replacement in Java 11

Can someone tell me the replacement of below listed API

SunToolkit.getContainingWindow

SwingUtilities2.getFontMetrics

SwingUtilities2.stringWidth

SwingUtilities2.drawString

SwingUtilities2.clipStringIfNecessary

SwingUtilities2.setLeadAnchorWithoutSelection

DefaultLookup.getIcon

And below listed classes

sun.font.FontUtilities
com.sun.java.swing.plaf.motif.MotifComboBoxUI
com.sun.java.swing.plaf.windows.WindowsComboBoxUI
com.sun.java.swing.plaf.motif.MotifScrollBarUI
com.sun.java.swing.plaf.windows.WindowsScrollBarUI 
com.sun.swing.internal.plaf.metal.resources.metal_it
like image 262
Maha Lax Avatar asked Jul 26 '26 15:07

Maha Lax


1 Answers

I got the link about SwingUtilities2. Please refer the below links.

https://bugs.openjdk.java.net/browse/JDK-8132119

SwingUtilities2.stringWidth
SwingUtilities2.drawString
SwingUtilities2.clipStringIfNecessary

These above methods can be replaced by javax.swing.plaf.basic.BasicGraphicsUtils

BasicGraphicsUtils.stringWidth
BasicGraphicsUtils.drawString
BasicGraphicsUtils.getClippedString
like image 163
Maha Lax Avatar answered Jul 29 '26 04:07

Maha Lax