本文整理匯總了Java中javax.swing.JDesktopPane.setBorder方法的典型用法代碼示例。如果您正苦於以下問題:Java JDesktopPane.setBorder方法的具體用法?Java JDesktopPane.setBorder怎麽用?Java JDesktopPane.setBorder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JDesktopPane
的用法示例。
在下文中一共展示了JDesktopPane.setBorder方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ViewingPanel
import javax.swing.JDesktopPane; //導入方法依賴的package包/類
/**
* Create a panel in which a JDesktopPane is used to
* to display screens for viewing a Player.
*
* @param title
* Title displayed in border of JDesktopPane
*/
public ViewingPanel(String title) {
TitledBorder tb;
setLayout(new BorderLayout());
desktop = new JDesktopPane();
desktop.setLayout(new TileLayout());
desktop.setBorder(tb = new TitledBorder(
new CompoundBorder(
new EtchedBorder(),
new EmptyBorder(4, 4, 4, 4)),
title));
tb.setTitleColor(Color.black);
desktop.setOpaque(false);
desktop.setBackground(UIManager.getColor("control"));
add(desktop, BorderLayout.CENTER);
hash = new Hashtable();
}
示例2: initialize
import javax.swing.JDesktopPane; //導入方法依賴的package包/類
/**
* Método responsável por inicializar todos os componentes swing deste frame
*
*/
private void initialize() {
frmGereciamentoDeBanco = new JFrame();
frmGereciamentoDeBanco.setResizable(false);
frmGereciamentoDeBanco.setTitle("Sistema de Gereciamento de Banco");
frmGereciamentoDeBanco.setBounds(100, 100, 800, 600);
frmGereciamentoDeBanco.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frmGereciamentoDeBanco.getContentPane().setLayout(null);
frmGereciamentoDeBanco.setLocationRelativeTo(null);
JLabel lblBanco = new JLabel("Banco:");
lblBanco.setFont(new Font("Tahoma", Font.BOLD, 14));
lblBanco.setBounds(10, 11, 74, 23);
frmGereciamentoDeBanco.getContentPane().add(lblBanco);
JLabel lblAgencia = new JLabel("Agência:");
lblAgencia.setFont(new Font("Tahoma", Font.BOLD, 14));
lblAgencia.setBounds(10, 45, 74, 23);
frmGereciamentoDeBanco.getContentPane().add(lblAgencia);
btnManterClientes = new JButton("Manter Clientes");
btnManterClientes.setBounds(10, 89, 170, 37);
frmGereciamentoDeBanco.getContentPane().add(btnManterClientes);
btnOperaesBancarias = new JButton("Operações Bancarias");
btnOperaesBancarias.setBounds(190, 89, 170, 37);
btnOperaesBancarias.setEnabled(Boolean.FALSE);
frmGereciamentoDeBanco.getContentPane().add(btnOperaesBancarias);
lblBancoResult = new JLabel("...");
lblBancoResult.setFont(new Font("Tahoma", Font.BOLD, 14));
lblBancoResult.setBounds(94, 11, 480, 20);
frmGereciamentoDeBanco.getContentPane().add(lblBancoResult);
lblAgenciaResult = new JLabel("...");
lblAgenciaResult.setFont(new Font("Tahoma", Font.BOLD, 14));
lblAgenciaResult.setBounds(94, 45, 480, 20);
frmGereciamentoDeBanco.getContentPane().add(lblAgenciaResult);
JSeparator separator = new JSeparator();
separator.setBounds(10, 79, 764, 11);
frmGereciamentoDeBanco.getContentPane().add(separator);
panelInterno = new JDesktopPane();
panelInterno.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));
panelInterno.setBounds(10, 137, 764, 414);
frmGereciamentoDeBanco.getContentPane().add(panelInterno);
panelInterno.setLayout(null);
frameInterno = new JInternalFrame("New JInternalFrame");
frameInterno.setBounds(10, 11, 744, 392);
panelInterno.add(frameInterno);
frameInterno.setVisible(false);
}
示例3: 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);
}