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


Java Box.setOpaque方法代码示例

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


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

示例1: createP3

import javax.swing.Box; //导入方法依赖的package包/类
JPanel createP3() {
	p3 = new JPanel(new BorderLayout());
	model = new DefaultListModel();
	list = new JList(model);
	list.setCellRenderer(new YTListRenderer());
	p3.add(new JScrollPane(list));
	Box box = Box.createHorizontalBox();
	box.add(Box.createHorizontalGlue());
	btnDwnld = new JButton("Download");
	btnDwnld.addActionListener(this);
	btnCancel = new JButton("Close");
	btnCancel.addActionListener(this);
	box.add(btnDwnld);
	box.add(Box.createHorizontalStrut(10));
	box.add(btnCancel);
	btnCancel.setPreferredSize(btnDwnld.getPreferredSize());
	box.add(Box.createHorizontalStrut(10));
	box.add(Box.createRigidArea(new Dimension(0, 40)));
	p3.add(box, BorderLayout.SOUTH);

	box.setOpaque(true);
	box.setBackground(StaticResource.titleColor);
	return p3;
}
 
开发者ID:kmarius,项目名称:xdman,代码行数:25,代码来源:YoutubeGrabberDlg.java

示例2: createExceptionsPanel

import javax.swing.Box; //导入方法依赖的package包/类
Box createExceptionsPanel() {
	Box box = Box.createVerticalBox();
	box.setOpaque(false);
	box.setBorder(new EmptyBorder(10, 0, 0, 10));

	Box b0 = Box.createHorizontalBox();
	b0.add(new JLabel(getString("LBL_EXCEPT")));
	b0.setBorder(new EmptyBorder(0, 0, 10, 0));
	b0.add(Box.createHorizontalGlue());
	box.add(b0);

	txtException = new JTextArea();
	txtException.setLineWrap(false);
	txtException.setWrapStyleWord(true);

	JScrollPane jsp = new JScrollPane(txtException);
	jsp.setPreferredSize(new Dimension(10, 10));

	box.add(jsp);

	Box b = Box.createHorizontalBox();
	b.add(new JLabel(getString("LBL_EXCEPT_LN")));
	b.add(Box.createHorizontalGlue());
	b.setBorder(new EmptyBorder(5, 0, 5, 0));
	box.add(b);

	return box;
}
 
开发者ID:kmarius,项目名称:xdman,代码行数:29,代码来源:ConfigDialog.java

示例3: createTypesPanel

import javax.swing.Box; //导入方法依赖的package包/类
Box createTypesPanel() {
	Box box = Box.createVerticalBox();
	box.setOpaque(false);
	box.setBorder(new EmptyBorder(10, 0, 0, 10));

	Box b0 = Box.createHorizontalBox();
	b0.add(new JLabel(getString("LBL_FILE_TYPES")));
	b0.setBorder(new EmptyBorder(0, 0, 10, 0));
	b0.add(Box.createHorizontalGlue());
	box.add(b0);

	txtArea = new JTextArea();
	txtArea.setWrapStyleWord(true);
	txtArea.setLineWrap(true);

	JScrollPane jsp = new JScrollPane(txtArea);
	jsp.setPreferredSize(new Dimension(10, 10));

	box.add(jsp);

	Box b = Box.createHorizontalBox();
	b.add(Box.createHorizontalGlue());

	defaults = new JButton(getString("LBL_DEFAULTS"));
	defaults.addActionListener(this);
	defaults.setName("LBL_DEFAULTS");

	b.add(defaults);
	b.setBorder(new EmptyBorder(5, 0, 5, 0));
	box.add(b);

	return box;
}
 
开发者ID:kmarius,项目名称:xdman,代码行数:34,代码来源:ConfigDialog.java

示例4: createConnectionPanel

import javax.swing.Box; //导入方法依赖的package包/类
Box createConnectionPanel() {
	Box box = Box.createVerticalBox();
	box.setOpaque(false);
	box.setBorder(new EmptyBorder(10, 0, 0, 10));

	Box box2 = Box.createHorizontalBox();
	box2.add(new JLabel(getString("DWN_TYM")));
	box2.add(Box.createHorizontalGlue());
	cmbTimeout = new JComboBox(new String[] { "10", "15", "20", "30", "45",
			"60", "120", "180", "240", "300" });
	cmbTimeout.setMaximumSize(cmbTimeout.getPreferredSize());
	box2.add(cmbTimeout);
	box.add(box2);
	box2.setBorder(new EmptyBorder(2, 0, 2, 0));

	Box box1 = Box.createHorizontalBox();
	box1.add(new JLabel(getString("DWN_SEG")));
	box1.add(Box.createHorizontalGlue());
	cmbConn = new JComboBox(new String[] { "1", "2", "3", "4", "5", "6",
			"7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "20",
			"24", "26", "28", "30", "32" });
	cmbConn.setMaximumSize(cmbTimeout.getPreferredSize());
	cmbConn.setPreferredSize(cmbTimeout.getPreferredSize());
	box1.add(cmbConn);
	box.add(box1);
	box1.setBorder(new EmptyBorder(2, 0, 2, 0));

	Box box3 = Box.createHorizontalBox();
	box3.add(new JLabel(getString("DWN_TCP")));
	box3.add(Box.createHorizontalGlue());
	cmbTcpW = new JComboBox(new String[] { "8", "16", "32", "64" });
	cmbTcpW.setMaximumSize(cmbTimeout.getPreferredSize());
	cmbTcpW.setPreferredSize(cmbTimeout.getPreferredSize());
	box3.add(cmbTcpW);
	box.add(box3);
	box3.setBorder(new EmptyBorder(2, 0, 2, 0));

	box.add(Box.createVerticalGlue());
	return box;
}
 
开发者ID:kmarius,项目名称:xdman,代码行数:41,代码来源:ConfigDialog.java

示例5: createGeneralPanel

import javax.swing.Box; //导入方法依赖的package包/类
Box createGeneralPanel() {
	chkDwnldPrg = new JCheckBox(getString("SHOW_DWNLD_PRG"));
	chkDwnldPrg.setContentAreaFilled(false);
	chkDwnldPrg.setFocusPainted(false);
	chkDwnldNotify = new JCheckBox(getString("SHOW_DWNLD_PRG_NOTIFY"));
	chkDwnldPrg.setContentAreaFilled(false);
	chkDwnldPrg.setFocusPainted(false);
	chkFinishedDlg = new JCheckBox(getString("SHOW_DWNLD_DLG"));
	chkFinishedDlg.setContentAreaFilled(false);
	chkFinishedDlg.setFocusPainted(false);
	chkFinishedNotify = new JCheckBox(getString("SHOW_DWNLD_NOTIFY"));
	chkFinishedNotify.setContentAreaFilled(false);
	chkFinishedNotify.setFocusPainted(false);
	// chkAllowBrowser = new JCheckBox(getString("ALLOW_BROWSER"));
	// chkAllowBrowser.setContentAreaFilled(false);
	// chkAllowBrowser.setFocusPainted(false);
	cmbDupAction = new JComboBox(new String[] {
			StringResource.getString("DUP__OP1"),
			StringResource.getString("DUP__OP2"),
			StringResource.getString("DUP__OP3"),
			StringResource.getString("DUP__OP4") });
	cmbDupAction.setBorder(null);
	cmbDupAction.setMaximumSize(new Dimension(chkDwnldPrg
			.getPreferredSize().width,
			cmbDupAction.getPreferredSize().height));

	Box box = Box.createVerticalBox();
	box.setOpaque(false);
	box.setBorder(new EmptyBorder(10, 0, 0, 10));

	Box b0 = Box.createHorizontalBox();
	b0.add(chkDwnldPrg);
	b0.add(Box.createHorizontalGlue());
	box.add(b0);
	Box b1 = Box.createHorizontalBox();
	b1.add(chkFinishedDlg);
	b1.add(Box.createHorizontalGlue());
	box.add(b1);
	
	Box b31 = Box.createHorizontalBox();
	b31.add(chkDwnldNotify);
	b31.add(Box.createHorizontalGlue());
	box.add(b31);

	Box b3 = Box.createHorizontalBox();
	b3.add(chkFinishedNotify);
	b3.add(Box.createHorizontalGlue());
	box.add(b3);
	// Box b2 = Box.createHorizontalBox();
	// b2.add(chkAllowBrowser);
	// b2.add(Box.createHorizontalGlue());
	// box.add(b2);

	Box b4 = Box.createHorizontalBox();
	b4.add(new JLabel(getString("SHOW_DUP_ACTION")));
	b4.add(Box.createHorizontalGlue());
	b4.add(cmbDupAction);
	box.add(Box.createVerticalStrut(10));
	box.add(b4);

	return box;
}
 
开发者ID:kmarius,项目名称:xdman,代码行数:63,代码来源:ConfigDialog.java

示例6: createLeftPanel

import javax.swing.Box; //导入方法依赖的package包/类
void createLeftPanel() {
	Box leftBox = Box.createVerticalBox();
	leftBox.setOpaque(true);
	leftBox.setBackground(StaticResource.titleColor);

	JLabel title = new JLabel(getString("CONFIG_TITLE"));
	title.setForeground(Color.white);
	title.setFont(title.getFont().deriveFont(Font.BOLD,
			title.getFont().getSize() * 1.2f));
	title.setBorder(new EmptyBorder(20, 20, 20, 40));

	leftBox.add(title);

	centerPanel.add(leftBox, BorderLayout.WEST);

	arrLbl = new JLabel[9];

	for (int i = 0; i < 9; i++) {
		String id = "CONFIG_LBL" + (i + 1);
		arrLbl[i] = new JLabel(getString(id));
		arrLbl[i].setName(id);
		arrLbl[i].addMouseListener(clickHandler);
		arrLbl[i].setForeground(Color.white);
		arrLbl[i].setFont(plainFont);
		arrLbl[i].setBorder(new EmptyBorder(5, 20, 5, 20));
		leftBox.add(arrLbl[i]);
	}
}
 
开发者ID:kmarius,项目名称:xdman,代码行数:29,代码来源:ConfigDialog.java

示例7: createP1

import javax.swing.Box; //导入方法依赖的package包/类
void createP1() {
	Box p11 = Box.createVerticalBox();
	p11.setBackground(Color.white);
	p11.setOpaque(true);
	p1 = new JPanel(new BorderLayout());
	Box b1 = Box.createHorizontalBox();
	b1.setBackground(Color.white);
	b1.setOpaque(true);
	b1.setBorder(new EmptyBorder(25, 15, 10, 15));
	JLabel lbl = new JLabel();
	lbl.setText(StringResource.getString("YT_LBL1"));
	lbl.setOpaque(false);
	JLabel icon = new JLabel(XDMIconMap.getIcon("YT_ICON"));
	icon.setMaximumSize(new Dimension(75, 75));
	b1.add(icon);
	b1.add(Box.createRigidArea(new Dimension(10, 10)));
	b1.add(lbl);
	ytaddr = new JTextField();
	ytaddr.setMaximumSize(new Dimension(ytaddr.getMaximumSize().width,
			ytaddr.getPreferredSize().height));
	p11.add(b1);
	Box b2 = Box.createHorizontalBox();
	b2.add(ytaddr);
	b2.setBackground(Color.white);
	b2.setOpaque(true);
	b2.setBorder(new EmptyBorder(10, 15, 15, 15));
	p11.add(b2);
	p11.add(Box.createVerticalStrut(20));

	p1.add(p11);

	Box b3 = Box.createHorizontalBox();
	get_video = new JButton(StringResource.getString("YT_LBL4"));
	btnDim = get_video.getPreferredSize();
	get_video.setName("YT_LBL4");
	get_video.addActionListener(this);
	cancel = new JButton(StringResource.getString("CANCEL"));
	cancel.setName("CANCEL");
	cancel.addActionListener(this);
	cancel.setPreferredSize(btnDim);
	b3.add(Box.createHorizontalGlue());
	b3.add(get_video);
	b3.add(Box.createRigidArea(new Dimension(10, 10)));
	b3.add(cancel);
	b3.setBorder(new EmptyBorder(10, 15, 10, 15));
	b3.setOpaque(true);
	b3.setBackground(StaticResource.titleColor);

	p1.add(b3, BorderLayout.SOUTH);
}
 
开发者ID:kmarius,项目名称:xdman,代码行数:51,代码来源:YoutubeGrabberDlg.java

示例8: createSchedulerPanel

import javax.swing.Box; //导入方法依赖的package包/类
Box createSchedulerPanel() {
	Box box = Box.createVerticalBox();
	box.setOpaque(false);
	box.setBorder(new EmptyBorder(10, 0, 0, 10));

	Box b0 = Box.createHorizontalBox();
	schedule = new JCheckBox(getString("LBL_Q"));
	schedule.setContentAreaFilled(false);
	schedule.setFocusPainted(false);
	// schedule.addActionListener(this);
	b0.add(schedule);
	b0.setBorder(new EmptyBorder(0, 0, 10, 0));
	b0.add(Box.createHorizontalGlue());
	box.add(b0);

	start = new SpinnerDateModel();
	end = new SpinnerDateModel();

	startDate = new JSpinner(start);
	startDate.setEditor(new JSpinner.DateEditor(startDate,
			"dd-MMM-yy hh:mm a"));
	startDate.setMaximumSize(startDate.getPreferredSize());

	endDate = new JSpinner(end);
	endDate
			.setEditor(new JSpinner.DateEditor(endDate, "dd-MMM-yy hh:mm a"));
	endDate.setMaximumSize(endDate.getPreferredSize());

	Box b1 = Box.createHorizontalBox();
	b1.add(new JLabel(getString("LBL_START_Q")));
	b1.add(Box.createHorizontalGlue());
	b1.add(startDate);

	box.add(b1);
	box.add(Box.createRigidArea(new Dimension(10, 10)));

	Box b2 = Box.createHorizontalBox();
	b2.add(new JLabel(getString("LBL_STOP_Q")));
	b2.add(Box.createHorizontalGlue());
	b2.add(endDate);

	box.add(b2);

	return box;
}
 
开发者ID:kmarius,项目名称:xdman,代码行数:46,代码来源:ConfigDialog.java

示例9: createSaveToPanel

import javax.swing.Box; //导入方法依赖的package包/类
Box createSaveToPanel() {
	Box box = Box.createVerticalBox();
	box.setOpaque(false);
	box.setBorder(new EmptyBorder(10, 0, 0, 10));

	Box b = Box.createHorizontalBox();
	b.add(new JLabel(getString("TMP_DIR")));
	b.add(Box.createHorizontalGlue());
	box.add(b);

	Box box1 = Box.createHorizontalBox();
	box1.setBorder(new EmptyBorder(5, 0, 5, 0));

	txtTmpDir = new JTextField(15);
	txtTmpDir.setMaximumSize(new Dimension(
			txtTmpDir.getMaximumSize().width,
			txtTmpDir.getPreferredSize().height));
	txtTmpDir.setEditable(false);
	txtTmpDir.setBackground(Color.white);

	box1.add(txtTmpDir);

	box1.add(Box.createRigidArea(new Dimension(10, 10)));

	br1 = new JButton("...");
	br1.addActionListener(this);
	br1.setName("BR_TMP_DIR");
	box1.add(br1);

	box.add(box1);

	Box b2 = Box.createHorizontalBox();
	b2.add(new JLabel(getString("DST_DIR")));
	b2.add(Box.createHorizontalGlue());
	box.add(b2);

	Box box2 = Box.createHorizontalBox();
	box2.setBorder(new EmptyBorder(5, 0, 5, 0));

	txtDstDir = new JTextField(15);
	txtDstDir.setMaximumSize(new Dimension(
			txtDstDir.getMaximumSize().width,
			txtDstDir.getPreferredSize().height));
	txtDstDir.setEditable(false);

	box2.add(txtDstDir);

	box2.add(Box.createRigidArea(new Dimension(10, 10)));

	br2 = new JButton("...");
	br2.addActionListener(this);
	br2.setName("BR_DST_DIR");
	box2.add(br2);

	txtDstDir.setBackground(Color.white);

	box.add(box2);

	box.add(Box.createVerticalGlue());

	return box;
}
 
开发者ID:kmarius,项目名称:xdman,代码行数:63,代码来源:ConfigDialog.java


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