当前位置: 首页>>代码示例>>Java>>正文


Java JTextPane.setComponentOrientation方法代码示例

本文整理汇总了Java中javax.swing.JTextPane.setComponentOrientation方法的典型用法代码示例。如果您正苦于以下问题:Java JTextPane.setComponentOrientation方法的具体用法?Java JTextPane.setComponentOrientation怎么用?Java JTextPane.setComponentOrientation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JTextPane的用法示例。


在下文中一共展示了JTextPane.setComponentOrientation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: LicenseWindow

import javax.swing.JTextPane; //导入方法依赖的package包/类
/**
 * Create the frame.
 */
public LicenseWindow(final String path) {
	
	setTitle("Coder HPMSA - [License]");
	setBounds(100, 100, 550, 550);
	setBackground(Color.decode("#066d95"));
	setLocationRelativeTo(null);
	setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
	
	this.setIconImage(Toolkit.getDefaultToolkit().
			getImage(getClass().getResource(LOGOPATH)));
	
	final JScrollPane scrollPane = new JScrollPane();
	scrollPane.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
	getContentPane().add(scrollPane, BorderLayout.CENTER);
	
	editorPane = new JTextPane();
	editorPane.setBackground(new Color(255, 255, 240));
	editorPane.setFont(new Font("Verdana", Font.PLAIN, 13));
	editorPane.setBorder(new EtchedBorder(EtchedBorder.RAISED, null, null));
	editorPane.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
	editorPane.setEditable(false);
	scrollPane.setViewportView(editorPane);
	
	final StyledDocument doc = editorPane.getStyledDocument();
	final SimpleAttributeSet center = new SimpleAttributeSet();
	StyleConstants.setAlignment(center, StyleConstants.ALIGN_CENTER);
	doc.setParagraphAttributes(0, doc.getLength()-1, center, false);
	
	fillEditorPane(path);
	setVisible(true);
}
 
开发者ID:Coder-ACJHP,项目名称:Hotel-Properties-Management-System,代码行数:35,代码来源:LicenseWindow.java

示例2: setHeader

import javax.swing.JTextPane; //导入方法依赖的package包/类
private static void setHeader(JPanel panel) {
  JTextPane header = new JTextPane();
  Insets inset = new Insets(0, 0, 0, 5);
  header.setPreferredSize(new Dimension(80, 15));
  header.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
  header.setEditable(false);
  header.setText("10:00");
  header.setMargin(inset);
  header.setBackground(Color.lightGray);
  panel.add(header);
}
 
开发者ID:vaclav,项目名称:voicemenu,代码行数:12,代码来源:Style.java

示例3: ReadLogsWindow

import javax.swing.JTextPane; //导入方法依赖的package包/类
/**
 * Create the frame.
 */
public ReadLogsWindow() {
	
	setTitle("Coder HPMSA - [Read Logs]");
	setBounds(100, 100, 660, 550);
	setBackground(Color.decode("#066d95"));
	setLocationRelativeTo(null);
	setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
	
	this.setIconImage(Toolkit.getDefaultToolkit().
			getImage(getClass().getResource(LOGOPATH)));
	
	final JScrollPane scrollPane = new JScrollPane();
	scrollPane.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
	getContentPane().add(scrollPane, BorderLayout.CENTER);
	
	editorPane = new JTextPane();
	editorPane.setBackground(new Color(255, 255, 240));
	editorPane.setFont(new Font("Verdana", Font.PLAIN, 13));
	editorPane.setBorder(new EtchedBorder(EtchedBorder.RAISED, null, null));
	editorPane.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
	editorPane.setEditable(false);
	scrollPane.setViewportView(editorPane);
	
	final JPanel filesPanel = new JPanel();
	filesPanel.setPreferredSize(new Dimension(200, 10));
	getContentPane().add(filesPanel, BorderLayout.EAST);
	filesPanel.setLayout(new BorderLayout(0, 0));
	
	final JScrollPane listScrollPane = new JScrollPane();
	listScrollPane.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
	listScrollPane.setViewportView(logFilesList());
	filesPanel.add(listScrollPane, BorderLayout.CENTER);
	
	final JPanel titlePanel = new JPanel();
	titlePanel.setPreferredSize(new Dimension(10, 40));
	titlePanel.setBackground(Color.decode("#066d95"));
	titlePanel.setAutoscrolls(true);
	getContentPane().add(titlePanel, BorderLayout.NORTH);
	titlePanel.setLayout(new BorderLayout(0, 0));
	
	final JLabel lblTitle = new JLabel("SYSTEM LOG RECORDS");
	lblTitle.setHorizontalTextPosition(SwingConstants.CENTER);
	lblTitle.setHorizontalAlignment(SwingConstants.CENTER);
	lblTitle.setAutoscrolls(true);
	lblTitle.setFont(new Font("Verdana", Font.BOLD, 25));
	lblTitle.setForeground(UIManager.getColor("Button.highlight"));
	titlePanel.add(lblTitle, BorderLayout.CENTER);
	
	final StyledDocument doc = editorPane.getStyledDocument();
	final SimpleAttributeSet center = new SimpleAttributeSet();
	StyleConstants.setAlignment(center, StyleConstants.ALIGN_CENTER);
	doc.setParagraphAttributes(0, doc.getLength(), center, false);
	
	setVisible(true);
}
 
开发者ID:Coder-ACJHP,项目名称:Hotel-Properties-Management-System,代码行数:59,代码来源:ReadLogsWindow.java


注:本文中的javax.swing.JTextPane.setComponentOrientation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。