当前位置: 首页>>代码示例>>Java>>正文


Java JideButton.setButtonStyle方法代码示例

本文整理汇总了Java中com.jidesoft.swing.JideButton.setButtonStyle方法的典型用法代码示例。如果您正苦于以下问题:Java JideButton.setButtonStyle方法的具体用法?Java JideButton.setButtonStyle怎么用?Java JideButton.setButtonStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jidesoft.swing.JideButton的用法示例。


在下文中一共展示了JideButton.setButtonStyle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getURLButton

import com.jidesoft.swing.JideButton; //导入方法依赖的package包/类
/**
 * Create a button that opens a URL in a web browser when clicked.
 * @param buttonText Button text
 * @param baseURL URL linked from the button
 * @param appendToURL Append text to the URL
 * @param doEncode encode the text using the UTF-8
 * @return a JideButton that opens the URL in a web browser
 */
private JideButton getURLButton(String buttonText, final String baseURL, 
	final String appendToURL, final boolean doEncode) {
	
	final String URL_CHARSET = "UTF-8";
	
	JideButton urlButton= new JideButton(buttonText);
	urlButton.setButtonStyle(ButtonStyle.HYPERLINK_STYLE);
	urlButton.setForeground(Color.BLUE);
	urlButton.setToolTipText("Lookup " + buttonText + " on the web");
	urlButton.addActionListener(new ActionListener() 
	{
		@Override
		public void actionPerformed(ActionEvent ae) {
			try {
				URL url;
				if (doEncode)
					url = new URL(baseURL + URLEncoder.encode(appendToURL, URL_CHARSET));
				else
					url = new URL(baseURL + appendToURL);
				
				java.awt.Desktop.getDesktop().browse(url.toURI());
			} catch (Exception ex) {
				ClientMiscUtils.reportError("Problem launching website: %s", ex);
			}
		}
	});
	
	return urlButton;
}
 
开发者ID:BaderLab,项目名称:pharmacogenomics,代码行数:38,代码来源:PGXPanel.java

示例2: CategoryPanel

import com.jidesoft.swing.JideButton; //导入方法依赖的package包/类
public CategoryPanel(String name, List<ResourceLocator> locatorList, Set<String> loadedTrackNames) {

        expanded = true;

        setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
        setAlignmentX(LEFT_ALIGNMENT);
        //setLayout(null);

        labelBar = new JPanel();
        //labelBar.setBackground(Color.blue);
        labelBar.setLayout(new BoxLayout(labelBar, BoxLayout.X_AXIS));
        labelBar.setBorder(BorderFactory.createRaisedBevelBorder()); //  new LabelBorder(Color.black));
        labelBar.setAlignmentX(LEFT_ALIGNMENT);
        JideButton toggleButton = new JideButton(expanded ? " - " : " + ");
        toggleButton.setButtonStyle(ButtonStyle.HYPERLINK_STYLE);
        labelBar.add(toggleButton);

        labelBar.add(new JLabel(name));
        this.add(labelBar);


        listPanel = new JPanel();
        listPanel.setLayout(new GridLayout(0, 4));
        for (ResourceLocator loc : locatorList) {
            final String trackName = loc.getTrackName();
            JCheckBox cb = new JCheckBox(trackName);
            cb.setSelected(loadedTrackNames.contains(trackName));
            listPanel.add(cb);
        }
        this.add(listPanel);

        toggleButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent actionEvent) {
                expanded = !expanded;
                listPanel.setVisible(expanded);
            }
        });
        labelBar.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent mouseEvent) {
                expanded = !expanded;
                listPanel.setVisible(expanded);
            }
        });

    }
 
开发者ID:theaidenlab,项目名称:Juicebox,代码行数:48,代码来源:CategoryPanel.java

示例3: createButton

import com.jidesoft.swing.JideButton; //导入方法依赖的package包/类
public AbstractButton createButton() {
	JideButton button = new JideButton();
	button.setButtonStyle(buttonStyle);
	return button;
}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:6,代码来源:JideButtonFactory.java


注:本文中的com.jidesoft.swing.JideButton.setButtonStyle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。