Search in sources :

Example 11 with JXHyperlink

use of org.jdesktop.swingx.JXHyperlink in project adempiere by adempiere.

the class StackedBox method addBox.

/**
   * Adds a new component to this <code>StackedBox</code>
   * 
   * @param title
   * @param component
   */
public void addBox(String title, Component component) {
    final JXCollapsiblePane collapsible = new JXCollapsiblePane();
    collapsible.getContentPane().setBackground(Color.WHITE);
    collapsible.add(component);
    collapsible.setBorder(new CompoundBorder(separatorBorder, collapsible.getBorder()));
    Action toggleAction = collapsible.getActionMap().get(JXCollapsiblePane.TOGGLE_ACTION);
    // use the collapse/expand icons from the JTree UI
    toggleAction.putValue(JXCollapsiblePane.COLLAPSE_ICON, UIManager.getIcon("Tree.expandedIcon"));
    toggleAction.putValue(JXCollapsiblePane.EXPAND_ICON, UIManager.getIcon("Tree.collapsedIcon"));
    JXHyperlink link = new JXHyperlink(toggleAction);
    link.setText(title);
    link.setFont(link.getFont().deriveFont(Font.BOLD));
    link.setOpaque(true);
    link.setBackground(getTitleBackgroundColor());
    link.setFocusPainted(false);
    link.setUnclickedColor(getTitleForegroundColor());
    link.setClickedColor(getTitleForegroundColor());
    link.setBorder(new CompoundBorder(separatorBorder, BorderFactory.createEmptyBorder(2, 4, 2, 4)));
    link.setBorderPainted(true);
    add(link);
    add(collapsible);
}
Also used : Action(javax.swing.Action) JXCollapsiblePane(org.jdesktop.swingx.JXCollapsiblePane) CompoundBorder(javax.swing.border.CompoundBorder) JXHyperlink(org.jdesktop.swingx.JXHyperlink)

Example 12 with JXHyperlink

use of org.jdesktop.swingx.JXHyperlink in project azure-tools-for-java by Microsoft.

the class AzureCodeSamples method onActionPerformed.

@Override
public boolean onActionPerformed(@NotNull AnActionEvent anActionEvent, @Nullable Operation operation) {
    JXHyperlink portalLing = new JXHyperlink();
    portalLing.setURI(URI.create("https://azure.microsoft.com/en-us/documentation/samples/?platform=java"));
    portalLing.doClick();
    return true;
}
Also used : JXHyperlink(org.jdesktop.swingx.JXHyperlink)

Aggregations

JXHyperlink (org.jdesktop.swingx.JXHyperlink)12 ActionEvent (java.awt.event.ActionEvent)3 File (java.io.File)2 AbstractAction (javax.swing.AbstractAction)2 ImportControllerUI (org.gephi.desktop.importer.api.ImportControllerUI)2 ValidationAwareActionListener (com.haulmont.cuba.desktop.sys.validation.ValidationAwareActionListener)1 Window (com.haulmont.cuba.gui.components.Window)1 ActionListener (java.awt.event.ActionListener)1 InputStream (java.io.InputStream)1 Action (javax.swing.Action)1 Border (javax.swing.border.Border)1 CompoundBorder (javax.swing.border.CompoundBorder)1 EmptyBorder (javax.swing.border.EmptyBorder)1 MostRecentFiles (org.gephi.desktop.mrufiles.api.MostRecentFiles)1 ProjectControllerUI (org.gephi.desktop.project.api.ProjectControllerUI)1 JXCollapsiblePane (org.jdesktop.swingx.JXCollapsiblePane)1 NotifyDescriptor (org.openide.NotifyDescriptor)1 FileObject (org.openide.filesystems.FileObject)1