Java Code Examples for org.jdesktop.swingx.JXHyperlink#addActionListener()

The following examples show how to use org.jdesktop.swingx.JXHyperlink#addActionListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DataDetails.java    From chipster with MIT License 5 votes vote down vote up
private JXHyperlink createHistoryLink(final DataBean data) {
	JXHyperlink link = new JXHyperlink();
	link.setText("Analysis history");
	link.addActionListener(new ActionListener() {		
		@Override
		public void actionPerformed(ActionEvent e) {				
			application.showHistoryScreenFor(data);
		}
	});
	return link;		
}
 
Example 2
Source File: DataDetails.java    From chipster with MIT License 3 votes vote down vote up
private Component createVisualisations() {
	JPanel panel = getPanelBase("wrap 1");
	
	List<VisualisationMethod> visualisations = VisualisationToolBar.getMethodsFor(datas);
		
	for (VisualisationMethod method : visualisations) {

		JXHyperlink link = new JXHyperlink();
		
		link.setBackground(new Color(0.95f, 0.95f, 0.95f));					
		
		link.addMouseListener(new LinkMouseListener(link));
		//hide focus border because it doesn't obey component size
		link.setFocusPainted(false);

		link.setIcon(method.getIcon());
		link.setIconTextGap(16);
		link.addActionListener(new VisualisationStarter(method, Session.getSession().getApplication()));
		link.setText(method.getName());
		
		panel.add(link, "width 300!, height 50!");
		
		focusableLinks.add(link);
	}
	
	return panel;
}