本文整理匯總了Java中javax.swing.JToolBar.putClientProperty方法的典型用法代碼示例。如果您正苦於以下問題:Java JToolBar.putClientProperty方法的具體用法?Java JToolBar.putClientProperty怎麽用?Java JToolBar.putClientProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JToolBar
的用法示例。
在下文中一共展示了JToolBar.putClientProperty方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ImageTopComponent
import javax.swing.JToolBar; //導入方法依賴的package包/類
ImageTopComponent(Image image, String className, int instanceNumber) {
setName(BrowserUtils.getSimpleType(className) + "#" + instanceNumber);
setToolTipText("Preview of " + className + "#" + instanceNumber);
setLayout(new BorderLayout());
int width = image.getWidth(null);
int height = image.getHeight(null);
BufferedImage displayedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics g = displayedImage.createGraphics();
drawChecker(g, 0, 0, width, height);
g.drawImage(image, 0, 0, null);
JComponent c = new JScrollPane(new JLabel(new ImageIcon(displayedImage)));
add(c, BorderLayout.CENTER);
JToolBar toolBar = new JToolBar();
toolBar.putClientProperty("JToolBar.isRollover", Boolean.TRUE); //NOI18N
toolBar.setFloatable(false);
toolBar.setName(Bundle.ImageDetailProvider_Toolbar());
//JButton button = new JButton();
//button.setText("");
toolBar.add(new ImageExportAction(image));
add(toolBar, BorderLayout.NORTH);
}
示例2: getHandler
import javax.swing.JToolBar; //導入方法依賴的package包/類
/**
* Returns the ToolBarHandler attached to the specified toolbar as a client
* property. If no handler is present, creates a new one and attaches it to
* the toolbar.
*/
private Handler getHandler(final JToolBar toolbar) {
if (toolbar == null)
return null;
Handler handler = extractHandler(toolbar);
if (handler == null) // Ensure that the toolbar has a handler
{
final String key = Handler.TOOL_BAR_HANDLER_KEY;
handler = new Handler(toolbar, this);
toolbar.putClientProperty(key, handler);
}
return handler;
}
示例3: createToolbar
import javax.swing.JToolBar; //導入方法依賴的package包/類
public JToolBar createToolbar(String containerCtx) {
JToolBar result = new JToolBar();
result.setName(containerCtx);
result.putClientProperty (KEY_CONTAINERCTX, containerCtx);
result.putClientProperty (KEY_CREATOR, this);
attachToToolbar(containerCtx, result);
populateToolbar(containerCtx, result); //XXX listener should do this
return result;
}
示例4: add
import javax.swing.JToolBar; //導入方法依賴的package包/類
@Override
public Component add(ProfilerToolbar toolbar, int index) {
JToolBar implToolbar = ((Impl)toolbar).toolbar;
implToolbar.setBorder(BorderFactory.createEmptyBorder());
implToolbar.setOpaque(false);
implToolbar.putClientProperty("Toolbar.noGTKBorder", Boolean.TRUE); // NOI18N
return add(implToolbar, index);
}