本文整理汇总了Java中javax.swing.BorderFactory.createTitledBorder方法的典型用法代码示例。如果您正苦于以下问题:Java BorderFactory.createTitledBorder方法的具体用法?Java BorderFactory.createTitledBorder怎么用?Java BorderFactory.createTitledBorder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.BorderFactory
的用法示例。
在下文中一共展示了BorderFactory.createTitledBorder方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureObjAttribTree
import javax.swing.BorderFactory; //导入方法依赖的package包/类
/**
* Add the tree panel to the view and configure other gui components.
*/
private void configureObjAttribTree() {
// set the position of the tree panel
java.awt.GridBagConstraints gbc = new java.awt.GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 0;
gbc.fill = java.awt.GridBagConstraints.BOTH;
gbc.weightx = 0.01;
gbc.weighty = 0.01;
jPObjAttribPreviewTree.add(objTreePanel, gbc);
objTreePanel.addObserver(this);
// set the title of the panel
TitledBorder titledBorder = BorderFactory.createTitledBorder(Constants.OBJECT_ATTRIBUTES_TEXT);
jPObjAttribButtons.setBorder(titledBorder);
objTreePanel.selectRoot();
objTreePanel.expandRows();
}
示例2: configureFrameAttribTree
import javax.swing.BorderFactory; //导入方法依赖的package包/类
/**
* Add the tree panel to the view and configure other gui components.
*/
private void configureFrameAttribTree() {
// set the position of the tree panel
java.awt.GridBagConstraints gbc = new java.awt.GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 0;
gbc.fill = java.awt.GridBagConstraints.BOTH;
gbc.weightx = 0.01;
gbc.weighty = 0.01;
jPFrameAttribPreviewTree.add(frameTreePanel, gbc);
frameTreePanel.addObserver(this);
// set the title of the panel
TitledBorder titledBorder = BorderFactory.createTitledBorder(Constants.FRAME_ATTRIBUTES_TEXT);
jPFrameAttribButtons.setBorder(titledBorder);
frameTreePanel.selectRoot();
frameTreePanel.expandRows();
}
示例3: setLayout
import javax.swing.BorderFactory; //导入方法依赖的package包/类
/**
* Define appearance of this component
*/
private void setLayout() {
GraphConstants.setSizeable(attributes, false);
GraphConstants.setGroupOpaque(attributes, true);
GraphConstants.setOpaque(attributes, true);
GraphConstants.setGradientColor(attributes, new Color(.1F, .1F, .9F, .3F));
titledBorder = BorderFactory.createTitledBorder(" " + name + " ");
GraphConstants.setBorder(attributes, titledBorder);
GraphConstants.setInset(attributes, (int) (GraphConstants.DEFAULTFONT.getSize() * 1.4));
GraphConstants.setEditable(attributes, false);
}
示例4: initializePanels
import javax.swing.BorderFactory; //导入方法依赖的package包/类
/**
* Initialize the panels.
*/
private void initializePanels() {
this.mDriverPanel = new JPanel();
this.mDriverPanel.setBounds(10, 10, FRAME_WIDTH - 25, 220);
final TitledBorder titledBorderDriver = BorderFactory.createTitledBorder(DRIVER_TITLE);
this.mDriverPanel.setBorder(titledBorderDriver);
this.mContainer.add(this.mDriverPanel);
this.mDriverPanel.setLayout(null);
this.mBrowserPanel = new JPanel();
this.mBrowserPanel.setBounds(10, 230, FRAME_WIDTH - 25, 100);
final TitledBorder titledBorderBinary = BorderFactory.createTitledBorder(BROWSER_TITLE);
this.mBrowserPanel.setBorder(titledBorderBinary);
this.mContainer.add(this.mBrowserPanel);
this.mBrowserPanel.setLayout(null);
this.mMiscellaneousPanel = new JPanel();
this.mMiscellaneousPanel.setBounds(10, 330, FRAME_WIDTH - 25, 70);
final TitledBorder titledBorderMiscellaneous = BorderFactory.createTitledBorder(MISCELLANEOUS_TITLE);
this.mMiscellaneousPanel.setBorder(titledBorderMiscellaneous);
this.mContainer.add(this.mMiscellaneousPanel);
this.mMiscellaneousPanel.setLayout(null);
this.mTrailerPanel = new JPanel();
this.mTrailerPanel.setBounds(10, 400, FRAME_WIDTH - 25, 80);
this.mContainer.add(this.mTrailerPanel);
this.mTrailerPanel.setLayout(null);
}
示例5: setLayout
import javax.swing.BorderFactory; //导入方法依赖的package包/类
/**
* Define apparence of this component
*/
private void setLayout() {
GraphConstants.setSizeable(attributes, false);
GraphConstants.setGroupOpaque(attributes, true);
GraphConstants.setOpaque(attributes, true);
GraphConstants.setGradientColor(attributes, new Color(.1F, .1F, .9F, .3F));
titledBorder = BorderFactory.createTitledBorder(" " + name + " ");
GraphConstants.setBorder(attributes, titledBorder);
GraphConstants.setInset(attributes, 15);
GraphConstants.setEditable(attributes, false);
}
示例6: init
import javax.swing.BorderFactory; //导入方法依赖的package包/类
public void init() {
Font font = new Font("Dialog", Font.PLAIN, 12); // NON-NLS: the font name
TitledBorder border = BorderFactory.createTitledBorder(
BorderFactory.createEtchedBorder(),
"Panel Title", // NON-NLS: the title of the border
TitledBorder.DEFAULT_JUSTIFICATION,
TitledBorder.DEFAULT_POSITION,
font);
JPanel panel = new JPanel();
panel.setBorder(border);
getContentPane().add(panel);
}
示例7: MyJPanel
import javax.swing.BorderFactory; //导入方法依赖的package包/类
public MyJPanel( String title, Color color ) {
super();
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
setBackground(Color.WHITE);
Border redline = BorderFactory.createLineBorder(color);
Border compound = BorderFactory.createTitledBorder(redline, title );
setBorder( compound );
// setBorder(Border.)
}
示例8: titledBorder
import javax.swing.BorderFactory; //导入方法依赖的package包/类
private static Border titledBorder(String title) {
String titleBorder = UIUtils.isWindowsLookAndFeel() ? " " : ""; //NOI18N
Border inner = BorderFactory.createEmptyBorder(0, 12, 3, 3);
Border outer = BorderFactory.createTitledBorder(titleBorder + title);
return BorderFactory.createCompoundBorder(outer, inner);
}
示例9: createTitledBorder
import javax.swing.BorderFactory; //导入方法依赖的package包/类
public static TitledBorder createTitledBorder(String title) {
return BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), title);
}
示例10: getTitledBorder
import javax.swing.BorderFactory; //导入方法依赖的package包/类
final public static TitledBorder getTitledBorder(String strPtitle, Font objPfont) {
final TitledBorder objLtitledBorder = BorderFactory.createTitledBorder(Strings.doConcat(' ', strPtitle, ' '));
objLtitledBorder.setTitleFont(objPfont);
return objLtitledBorder;
}
示例11: localizedBorder
import javax.swing.BorderFactory; //导入方法依赖的package包/类
/**
* Get a titled border with Messages.message(key) as text.
*
* @param key The key to use.
* @return The {@code TitledBorder}.
*/
public static TitledBorder localizedBorder(String key) {
return BorderFactory.createTitledBorder(BorderFactory
.createEmptyBorder(), Messages.message(key));
}