use of javax.swing.event.MouseInputAdapter in project android by JetBrains.
the class ChooseApiLevelDialog method createCenterPanel.
@Nullable
@Override
protected JComponent createCenterPanel() {
myDistributionChart.registerDistributionSelectionChangedListener(this);
myDistributionChart.init();
myScrollPane.getViewport().setOpaque(false);
myScrollPane.setOpaque(false);
myScrollPane.setBorder(null);
myDescriptionLeft.setForeground(JBColor.foreground());
myDescriptionLeft.setBackground(JBColor.background());
myDescriptionRight.setForeground(JBColor.foreground());
myDescriptionRight.setBackground(JBColor.background());
myLearnMoreLinkLabel.setForeground(JBColor.blue);
myLearnMoreLinkLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
Map<TextAttribute, ?> attributes = ImmutableMap.of(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
myLearnMoreLinkLabel.setFont(myLearnMoreLinkLabel.getFont().deriveFont(attributes));
myLearnMoreLinkLabel.addMouseListener(new MouseInputAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
try {
BrowserUtil.browse(new URL(myLearnMoreLinkLabel.getText()));
} catch (MalformedURLException e1) {
// Pass
}
}
});
if (mySelectedApiLevel >= 0) {
myDistributionChart.selectDistributionApiLevel(mySelectedApiLevel);
}
return myPanel;
}
Aggregations