本文整理汇总了Java中javax.swing.UIManager.LookAndFeelInfo方法的典型用法代码示例。如果您正苦于以下问题:Java UIManager.LookAndFeelInfo方法的具体用法?Java UIManager.LookAndFeelInfo怎么用?Java UIManager.LookAndFeelInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.UIManager
的用法示例。
在下文中一共展示了UIManager.LookAndFeelInfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import javax.swing.UIManager; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
robot = new Robot();
UIManager.LookAndFeelInfo[] lookAndFeelArray
= UIManager.getInstalledLookAndFeels();
for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) {
String lookAndFeelString = lookAndFeelItem.getClassName();
if (tryLookAndFeel(lookAndFeelString)) {
createUI();
performTest();
robot.waitForIdle();
}
}
if (!"".equals(errorMessage)) {
throw new RuntimeException(errorMessage);
}
}
示例2: main
import javax.swing.UIManager; //导入方法依赖的package包/类
public static void main(String[] args) throws Throwable {
//Execute test for all supported look and feels
UIManager.LookAndFeelInfo[] lookAndFeelArray
= UIManager.getInstalledLookAndFeels();
for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) {
String lookAndFeelString = lookAndFeelItem.getClassName();
UIManager.setLookAndFeel(lookAndFeelString);
// Test getTableCellRendererComponent method by passing null table
JTableHeader header = new JTableHeader();
header.getDefaultRenderer().getTableCellRendererComponent(null,
" test ", true, true, -1, 0);
}
}
示例3: main
import javax.swing.UIManager; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
Robot robot = new Robot();
UIManager.LookAndFeelInfo[] lookAndFeelArray
= UIManager.getInstalledLookAndFeels();
for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) {
String lookAndFeelString = lookAndFeelItem.getClassName();
if (tryLookAndFeel(lookAndFeelString)) {
// create UI
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
createUI(lookAndFeelString);
}
});
robot.waitForIdle();
executeTest(robot);
} else {
throw new RuntimeException("Setting Look and Feel Failed");
}
}
}
示例4: main
import javax.swing.UIManager; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
UIManager.LookAndFeelInfo[] installedLookAndFeels = UIManager.getInstalledLookAndFeels();
// try to test all installed Look and Feels
for (UIManager.LookAndFeelInfo lookAndFeel : installedLookAndFeels) {
String name = lookAndFeel.getName();
System.out.println("Testing " + name);
// Some Look and Feels work only when test is run in a GUI environment
// (GTK+ LAF is an example)
try {
UIManager.setLookAndFeel(lookAndFeel.getClassName());
checkTitleColor();
System.out.println(" titleColor test ok");
checkTitleFont();
System.out.println(" titleFont test ok");
}
catch (UnsupportedLookAndFeelException e) {
System.out.println(" Note: LookAndFeel " + name
+ " is not supported on this configuration");
}
}
}
示例5: main
import javax.swing.UIManager; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
robot = new Robot();
robot.delay(2000);
UIManager.LookAndFeelInfo[] lookAndFeelArray
= UIManager.getInstalledLookAndFeels();
for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) {
executeCase(lookAndFeelItem.getClassName());
}
if (!"".equals(errorString)) {
throw new RuntimeException("Error Log:\n" + errorString);
}
}
示例6: main
import javax.swing.UIManager; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
robot = new Robot();
robot.delay(1000);
UIManager.LookAndFeelInfo[] lookAndFeelArray
= UIManager.getInstalledLookAndFeels();
for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) {
executeCase(lookAndFeelItem.getClassName(),
lookAndFeelItem.getName());
}
if (!"".equals(errorString)) {
throw new RuntimeException("Error Log:\n" + errorString);
}
}
示例7: setLookAndFeel
import javax.swing.UIManager; //导入方法依赖的package包/类
private static void setLookAndFeel(final UIManager.LookAndFeelInfo laf) {
try {
UIManager.setLookAndFeel(laf.getClassName());
System.out.println("LookAndFeel: " + laf.getClassName());
} catch (ClassNotFoundException | InstantiationException |
UnsupportedLookAndFeelException | IllegalAccessException e) {
throw new RuntimeException(e);
}
}
示例8: main
import javax.swing.UIManager; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
robot = new java.awt.Robot();
UIManager.LookAndFeelInfo[] lookAndFeelArray
= UIManager.getInstalledLookAndFeels();
for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) {
String lookAndFeelString = lookAndFeelItem.getClassName();
if (tryLookAndFeel(lookAndFeelString)) {
createUI(lookAndFeelString);
robot.waitForIdle();
executeTest(lookAndFeelString);
}
}
if (!"".equals(errorMessage)) {
throw new RuntimeException(errorMessage);
}
}
示例9: main
import javax.swing.UIManager; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
robot = new Robot();
robot.delay(2000);
UIManager.LookAndFeelInfo[] lookAndFeelArray
= UIManager.getInstalledLookAndFeels();
for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) {
executeCase(lookAndFeelItem.getClassName());
}
}
示例10: test
import javax.swing.UIManager; //导入方法依赖的package包/类
private static void test(final boolean lock) {
for (final UIManager.LookAndFeelInfo laf : getInstalledLookAndFeels()) {
try {
SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf));
barrier.await();
SwingUtilities.invokeAndWait(() -> slam(lock));
barrier.await();
} catch (final Exception e) {
throw new RuntimeException(e);
}
}
}
示例11: main
import javax.swing.UIManager; //导入方法依赖的package包/类
public static void main(final String[] args) throws Exception {
for (final UIManager.LookAndFeelInfo laf : getInstalledLookAndFeels()) {
SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf));
SwingUtilities.invokeAndWait(new MisplacedBorder());
}
System.out.println("Test passed");
}
示例12: setLookAndFeel
import javax.swing.UIManager; //导入方法依赖的package包/类
private static void setLookAndFeel(final UIManager.LookAndFeelInfo laf) {
try {
UIManager.setLookAndFeel(laf.getClassName());
} catch (ClassNotFoundException | InstantiationException |
UnsupportedLookAndFeelException | IllegalAccessException e) {
throw new RuntimeException(e);
}
}
示例13: main
import javax.swing.UIManager; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
robot = new Robot();
robot.setAutoDelay(100);
for (UIManager.LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) {
try {
SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf));
System.out.println("Test for LookAndFeel " + laf.getClassName());
new bug4870644();
System.out.println("Test passed for LookAndFeel " + laf.getClassName());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
示例14: setLookAndFeel
import javax.swing.UIManager; //导入方法依赖的package包/类
private static void setLookAndFeel(final UIManager.LookAndFeelInfo info) {
try {
UIManager.setLookAndFeel(info.getClassName());
} catch (ClassNotFoundException | InstantiationException |
UnsupportedLookAndFeelException | IllegalAccessException e) {
throw new RuntimeException(e);
}
}
示例15: main
import javax.swing.UIManager; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
for (UIManager.LookAndFeelInfo lookAndFeelInfo : UIManager.getInstalledLookAndFeels()) {
UIManager.setLookAndFeel(lookAndFeelInfo.getClassName());
String tmpdir = System.getProperty("java.io.tmpdir");
System.out.println("tmp dir " + tmpdir);
new JFileChooser(new File(tmpdir+"/temp"));
System.out.println("Test passed for LookAndFeel " + lookAndFeelInfo.getClassName());
}
}