• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java JXRootPane类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.jdesktop.swingx.JXRootPane的典型用法代码示例。如果您正苦于以下问题:Java JXRootPane类的具体用法?Java JXRootPane怎么用?Java JXRootPane使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

JXRootPane类属于org.jdesktop.swingx包,在下文中一共展示了JXRootPane类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: splash

点赞 3

import org.jdesktop.swingx.JXRootPane; //导入依赖的package包/类
public void splash()
  {
      frame = new JXFrame();
      frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
frame.setUndecorated(true);
      frame.setRootPane(new JXRootPane());
      frame.getRootPaneExt().setDoubleBuffered(true);
      frame.getRootPaneExt().setBackground(new Color(255,255,255,255));
      frame.getRootPaneExt().setOpaque(false);
   frame.getContentPane().add(createContentPane());
frame.pack();
WindowUtils.centerOnScreen(frame);
      try
      {
          UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
      }
      catch (Exception e)
      {
          e.printStackTrace();
      }
      SwingUtilities.updateComponentTreeUI(frame);
      frame.setVisible(true);
  }
 

开发者ID:shevek,
项目名称:spring-rich-client,
代码行数:24,
代码来源:DataEditorSplash.java

示例2: showFindBar

点赞 2

import org.jdesktop.swingx.JXRootPane; //导入依赖的package包/类
/**
 * Show a incremental-find widget targeted at the searchable.
 * 
 * This implementation uses a JXFindBar and inserts it into the
 * target's toplevel container toolbar. 
 * 
 * PENDING: Nothing shown if there is no toolbar found. 
 * 
 * @param target - the component associated with the searchable
 * @param searchable - the object to search.
 */
public void showFindBar(JComponent target, Searchable searchable) {
    if (target == null) return;
    if (findBar == null) {
        findBar = getSharedFindBar();
    } else {
        releaseFindBar();
    }
    Window topLevel = SwingUtilities.getWindowAncestor(target);
    if (topLevel instanceof JXFrame) {
        JXRootPane rootPane = ((JXFrame) topLevel).getRootPaneExt();
        JToolBar toolBar = rootPane.getToolBar();
        if (toolBar == null) {
            toolBar = new JToolBar();
            rootPane.setToolBar(toolBar);
        }
        toolBar.add(findBar, 0);
        rootPane.revalidate();
        KeyboardFocusManager.getCurrentKeyboardFocusManager().focusNextComponent(findBar);
        
    }
    lastFindBarTarget = target;
    findBar.setLocale(target.getLocale());
    target.putClientProperty(AbstractSearchable.MATCH_HIGHLIGHTER, Boolean.TRUE);
    getSharedFindBar().setSearchable(searchable);
    installFindRemover(target, findBar);
}
 

开发者ID:RockManJoe64,
项目名称:swingx,
代码行数:38,
代码来源:SearchFactory.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)