Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
11.2
Description
When using FlatLaf Look and Feel, incorrect rendering of tree item under the context menu in the BeanTreeView component occurs. This problem can be easily reproduced by the following simple example.
import com.formdev.flatlaf.FlatLightLaf; import org.openide.explorer.ExplorerManager; import org.openide.explorer.view.BeanTreeView; import org.openide.nodes.AbstractNode; import org.openide.nodes.Children; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; public class SampleFrame extends JFrame implements ExplorerManager.Provider { private final ExplorerManager explorerManager = new ExplorerManager(); public SampleFrame() throws HeadlessException { setSize(300, 400); explorerManager.setRootContext(new SampleNode()); BeanTreeView beanTreeView = new BeanTreeView(); getContentPane().add(beanTreeView, BorderLayout.CENTER); } @Override public ExplorerManager getExplorerManager() { return explorerManager; } private static class SampleNode extends AbstractNode { public SampleNode() { super(Children.LEAF); setName("SampleNode"); } @Override public Action[] getActions(boolean context) { AbstractAction action = new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { } }; action.putValue(Action.NAME, "Sample"); return new Action[]{action}; } } public static void main(String[] args) { SwingUtilities.invokeLater(() -> { FlatLightLaf.install(); SampleFrame frame = new SampleFrame(); frame.setDefaultCloseOperation(EXIT_ON_CLOSE); frame.setVisible(true); }); } }
Netbeans Services Window