javax.swing.JDesktopPane.setDesktopManager()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(91)

本文整理了Java中javax.swing.JDesktopPane.setDesktopManager()方法的一些代码示例,展示了JDesktopPane.setDesktopManager()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JDesktopPane.setDesktopManager()方法的具体详情如下:
包路径:javax.swing.JDesktopPane
类名称:JDesktopPane
方法名:setDesktopManager

JDesktopPane.setDesktopManager介绍

暂无

代码示例

代码示例来源:origin: magefree/mage

public static void main(String args[]) {
    SwingUtilities.invokeLater(() -> {
      JFrame frame = new JFrame();
      frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

      JDesktopPane desktopPane = new JDesktopPane();
      DesktopManager dm = new MageDesktopManager();
      desktopPane.setDesktopManager(dm);
      JInternalFrame internalFrame = new JInternalFrame("Test Internal Frame", true, false, true, true);
      internalFrame.setSize(200, 150);
      internalFrame.setVisible(true);
      desktopPane.add(internalFrame);

      frame.add(desktopPane, BorderLayout.CENTER);
      frame.setSize(800, 600);
      frame.setVisible(true);
    });
  }
}

代码示例来源:origin: magefree/mage

desktopPane.setDesktopManager(new MageDesktopManager());

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

public void setDesktopManager(SquirrelDesktopManager squirrelDesktopManager)
{
 super.setDesktopManager(new DesktopManagerWrapper(squirrelDesktopManager));
}

代码示例来源:origin: realXuJiang/bigtable-sql

public void setDesktopManager(SquirrelDesktopManager squirrelDesktopManager)
{
 super.setDesktopManager(new DesktopManagerWrapper(squirrelDesktopManager));
}

代码示例来源:origin: stackoverflow.com

JDesktopPane jdp = new JDesktopPane();
jdp.setDesktopManager(new DefaultDesktopManager());

代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf

public Component create(Context context) {
    JDesktopPane desktopPane = new JDesktopPane();
    desktopPane.setDesktopManager(new ContentDesktopManager());
    return desktopPane;
  }
}

代码示例来源:origin: khuxtable/seaglass

protected void uninstallDesktopManager() {
  if (oldDesktopManager != null && !(oldDesktopManager instanceof UIResource)) {
    desktopManager = desktop.getDesktopManager();
    if (desktopManager == null || desktopManager instanceof UIResource) {
      desktop.setDesktopManager(oldDesktopManager);
    }
  }
  oldDesktopManager = null;
  super.uninstallDesktopManager();
}

代码示例来源:origin: stackoverflow.com

public Demo() {
    JFrame frame = new JFrame();
    frame.setSize(300,300);
    JDesktopPane df = new JDesktopPane();
    DesktopManager dm = df.getDesktopManager();
    df.setDesktopManager(new DefaultDesktopManager(){
        public void dragFrame(JComponent f, int newX, int newY) {
         super.dragFrame(f, newX, 5);
        }

    });
    JInternalFrame jif = new JInternalFrame("test ");
    jif.setLocation(5, 5);
    jif.setSize(150,100);
    jif.setVisible(true);
    df.add(jif);
    frame.setContentPane(df);
    frame.setVisible(true);
}

代码示例来源:origin: khuxtable/seaglass

protected void installDesktopManager() {
  if (UIManager.getBoolean("InternalFrame.useTaskBar")) {
    desktopManager = oldDesktopManager = desktop.getDesktopManager();
    if (!(desktopManager instanceof SeaGlassDesktopManager)) {
      desktopManager = new SeaGlassDesktopManager();
      desktop.setDesktopManager(desktopManager);
    }
  } else {
    super.installDesktopManager();
  }
}

代码示例来源:origin: stackoverflow.com

desktopPane.setDesktopManager(dm);
JInternalFrame internalFrame = new JInternalFrame("Test Internal Frame", true, false, true, true);
internalFrame.setSize(200, 150);

代码示例来源:origin: stackoverflow.com

JDesktopPane background = new JDesktopPane();
 JInternalFrame internalFrame = new JInternalFrame("Internal Frame",
     true, true, true, true);
 DesktopManager manager = new DefaultDesktopManager() {
   /** This moves the <code>JComponent</code> and repaints the damaged areas. */
   @Override
   public void setBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight) {
     boolean didResize = (f.getWidth() != newWidth || f.getHeight() != newHeight);
     if (!inBounds((JInternalFrame) f, newX, newY, newWidth, newHeight)) return;
     f.setBounds(newX, newY, newWidth, newHeight);
     if(didResize) {
       f.validate();
     } 
   }
   protected boolean inBounds(JInternalFrame f, int newX, int newY, int newWidth, int newHeight) {
     if (newX < 0 || newY < 0) return false;
     if (newX + newWidth > f.getDesktopPane().getWidth()) return false;
     if (newY + newHeight > f.getDesktopPane().getHeight()) return false;
     return true;
   }
 };
 background.setDesktopManager(manager);

代码示例来源:origin: cmu-phil/tetrad

/**
 * Constructs a new desktop.
 */
public TetradDesktop() {
  setBackground(new Color(204, 204, 204));
  sessionNodeKeys = new ArrayList<>();
  // Create the desktop pane.
  this.desktopPane = new JDesktopPane();
  // Do Layout.
  setLayout(new BorderLayout());
  desktopPane.setDesktopManager(new DefaultDesktopManager());
  desktopPane.setBorder(new BevelBorder(BevelBorder.LOWERED));
  desktopPane.addPropertyChangeListener(this);
  // HPC account manager
  final org.hibernate.Session session = TetradDatabaseApplication
      .getSessionFactory().openSession();
  this.hpcAccountManager = new HpcAccountManager(session);
  // HPC Job Manager
  int processors = Runtime.getRuntime().availableProcessors();
  this.hpcJobManager = new HpcJobManager(session, processors);
  this.setupDesktop();
  Preferences.userRoot().putBoolean("displayLogging", false);
  // setDisplayLogging(Preferences.userRoot().getBoolean("displayLogging",
  // false));
  TetradLogger.getInstance()
      .addTetradLoggerListener(new LoggerListener());
  // Bug in Swing for 1.7.
  // System.setProperty("java.util.Arrays.useLegacyMergeSort", "true");
  setTransferHandler(new SessionFileTransferHandler());
}

代码示例来源:origin: stackoverflow.com

public JComponent makeUI() {
 JDesktopPane desktop = new JDesktopPane();
 desktop.setDesktopManager(new DefaultDesktopManager() {
  @Override protected Rectangle getBoundsForIconOf(JInternalFrame f) {
   Rectangle r = super.getBoundsForIconOf(f);

代码示例来源:origin: stackoverflow.com

desktop.setDesktopManager( new NoDragDesktopManager() );
getContentPane().add( desktop );

代码示例来源:origin: com.eas.platypus/platypus-js-scalable-widget

dp.setLocation(20, 20);
dp.setSize(250, 450);
dp.setDesktopManager(new DefaultDesktopManager(){
  @Override
  public void dragFrame(JComponent f, int newX, int newY) {

代码示例来源:origin: com.eas.platypus/platypus-js-scalable-widget

MouseMotionListener[] mmlisteners = dragTarget.getMouseMotionListeners();
if (mlisteners != null && mmlisteners != null) {
  ldp.setDesktopManager(dummyDesktopManager);
  try {
    for (int i = 0; i < mlisteners.length; i++) {
    ldp.setDesktopManager(ldm);

代码示例来源:origin: stackoverflow.com

desktop.setDesktopManager( new MaximizeDesktopManager() );

代码示例来源:origin: stackoverflow.com

dt.setDesktopManager(new MyDesktopManager());
dt.setAutoscrolls(true);
int xx = 5;

相关文章