List of usage examples for javax.swing JLabel setComponentOrientation
public void setComponentOrientation(ComponentOrientation o)
From source file:gg.pistol.sweeper.gui.component.DecoratedPanel.java
/** * Helper factory method for creating clickable links. * * @param linkText//from w w w . j a v a 2s.c o m * a string that will be displayed as a link * @param action * the action performed at click * @return the link component */ protected JComponent createLink(String linkText, final Runnable action) { Preconditions.checkNotNull(linkText); Preconditions.checkNotNull(action); JLabel link = new JLabel("<html><a href=''>" + linkText + "</a></html>"); link.setComponentOrientation(ComponentOrientation.getOrientation(i18n.getLocale())); link.setCursor(new Cursor(Cursor.HAND_CURSOR)); link.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { action.run(); } }); return link; }