當前位置: 首頁>>代碼示例>>Java>>正文


Java JDesktopPane.setDragMode方法代碼示例

本文整理匯總了Java中javax.swing.JDesktopPane.setDragMode方法的典型用法代碼示例。如果您正苦於以下問題:Java JDesktopPane.setDragMode方法的具體用法?Java JDesktopPane.setDragMode怎麽用?Java JDesktopPane.setDragMode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JDesktopPane的用法示例。


在下文中一共展示了JDesktopPane.setDragMode方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: InternalFrameDemo

import javax.swing.JDesktopPane; //導入方法依賴的package包/類
public InternalFrameDemo() {
    super("InternalFrameDemo");

    // Make the big window be indented 50 pixels from each edge
    // of the screen.
    int inset = 50;
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    setBounds(inset, inset, screenSize.width - inset * 2, screenSize.height - inset * 2);

    // Set up the GUI.
    desktop = new JDesktopPane(); // a specialized layered pane
    createFrame(); // create first "window"
    setContentPane(desktop);
    setJMenuBar(createMenuBar());

    // Make dragging a little faster but perhaps uglier.
    desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:19,代碼來源:InternalFrameDemo.java

示例2: createUI

import javax.swing.JDesktopPane; //導入方法依賴的package包/類
private static void createUI(String lookAndFeelString) {
    internalFrame = new JInternalFrame("Internal", true, true, true, true);
    internalFrame.setDefaultCloseOperation(
            WindowConstants.DO_NOTHING_ON_CLOSE);
    internalFrame.setSize(200, 200);

    JDesktopPane desktopPane = new JDesktopPane();
    desktopPane.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
    desktopPane.add(internalFrame);

    mainFrame = new JFrame(lookAndFeelString);
    mainFrame.setSize(640, 480);
    mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    mainFrame.setContentPane(desktopPane);

    mainFrame.setVisible(true);
    internalFrame.setVisible(true);

}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:20,代碼來源:NormalBoundsTest.java

示例3: createNewDesktop

import javax.swing.JDesktopPane; //導入方法依賴的package包/類
@Override
JComponent createNewDesktop() {
  JDesktopPane newDesktop = new JDesktopPane();
  newDesktop.setDesktopManager(new DefaultDesktopManager());
  newDesktop.addContainerListener(this.getMode());
  logger.debug("Add event in Menu");
  newDesktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
  return newDesktop;
}
 
開發者ID:IGNF,項目名稱:geoxygene,代碼行數:10,代碼來源:FloatingMainFrame.java

示例4: JInternalFrameTest

import javax.swing.JDesktopPane; //導入方法依賴的package包/類
public JInternalFrameTest() {
	super();
	try {
		setTitle("人事管理");
		setBounds(100, 100, 350, 150);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		// 創建桌麵麵板
		desktopPane = new JDesktopPane();
		desktopPane.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE); // 設置內部窗體拖動模式
		getContentPane().add(desktopPane, BorderLayout.CENTER);
		// 桌麵添加背景圖片
		final JLabel backLabel = new JLabel();
		// URL resource = this.getClass().getResource("back.jpg"); //圖片
		BufferedImage resource = ImageIO.read(new File("e://test//dd.png"));
		ImageIcon icon = new ImageIcon(resource); // 設置圖片
		backLabel.setIcon(icon);
		backLabel.setBounds(0, 0, icon.getIconWidth(), icon.getIconHeight()); // 設置邊界
		desktopPane.add(backLabel, new Integer(Integer.MIN_VALUE)); // 添加到指定索引位置

		// 添加button
		final JPanel panel = new JPanel();
		getContentPane().add(panel, BorderLayout.NORTH);
		JButton jButton_p = new JButton("人事");
		jButton_p.addActionListener(new BAlistener(null, "人事")); // 監聽事件
		JButton jButton_r = new JButton("帳物");
		jButton_r.addActionListener(new BAlistener(null, "帳物")); // 監聽事件
		JButton jButton_t = new JButton("待遇");
		jButton_t.addActionListener(new BAlistener(null, "待遇")); // 監聽事件
		panel.add(jButton_p);
		panel.add(jButton_r);
		panel.add(jButton_t);
	} catch (IOException e) { 
		e.printStackTrace();
	}
}
 
開發者ID:DerekWu-lanxuanfeng,項目名稱:ImageMegre,代碼行數:36,代碼來源:JInternalFrameTest.java

示例5: MainContainer

import javax.swing.JDesktopPane; //導入方法依賴的package包/類
/**
 * Create the frame.
 */
public MainContainer() {
	
	//Make the big window be indented 50 pixels from each edge
       //of the screen.
       int inset = 50;
       Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
       setBounds(inset, inset,
                 screenSize.width  - inset*2,
                 screenSize.height - inset*2);
       
	setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	//setBounds(100, 100, 1145, 664);
	JPanel contentPane = new JPanel();
	setContentPane(contentPane);
	contentPane.setLayout(new BorderLayout(0, 0));
	
	JPanel menuContainer = new JPanel();
	//menuContainer.setBorder(new LineBorder(new Color(0, 0, 0)));
	contentPane.add(menuContainer, BorderLayout.NORTH);
	menuContainer.setPreferredSize(new Dimension((int) contentPane.getSize().getWidth(), 140));
	menuContainer.setLayout(new BorderLayout(0, 0));
	
	ToolBarContainer toolMenu = new ToolBarContainer(this, this.getWidth(),160);
	toolMenu.setBorder(new LineBorder(Color.GREEN));
	menuContainer.add(toolMenu, BorderLayout.CENTER);
	
	desktopContainerPanel = new JDesktopPane();
	desktopContainerPanel.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
	desktopContainerPanel.setBackground(UIManager.getColor("InternalFrame.activeTitleBackground"));
	desktopContainerPanel.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
	contentPane.add(desktopContainerPanel);
	
	//createFrame(desktopContainerPanel, new MyInternalFrame()); //Create first window
	
	JPanel statusPanel = new JPanel();
	statusPanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
	statusPanel.setPreferredSize(new Dimension(1145, 30));
	contentPane.add(statusPanel, BorderLayout.SOUTH);
	
	JLabel lblNewLabel = new JLabel("iEATool");
	statusPanel.add(lblNewLabel);
}
 
開發者ID:connect2vishal,項目名稱:iEATool,代碼行數:46,代碼來源:MainContainer.java


注:本文中的javax.swing.JDesktopPane.setDragMode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。