publicstaticvoid main(String[] args) {
LookAndFeelInfo[] lafInfo = UIManager.getInstalledLookAndFeels(); if (Platform.isWindows()) { // Make sure we don't have GTK. if (hasLAF("gtk", lafInfo)) { thrownew RuntimeException("On windows, but GTK is present");
}
// Make sure we don't have Aqua. if (hasLAF("mac", lafInfo)) { thrownew RuntimeException("On windows, but Aqua is present");
}
// Make sure we have Windows. if (!hasLAF("windows", lafInfo)) { thrownew RuntimeException("On windows and don't have Windows");
}
} elseif (Platform.isOSX()) { // Make sure we don't have GTK. if (hasLAF("gtk", lafInfo)) { thrownew RuntimeException("On mac, but GTK is present");
}
// Make sure we don't have Windows. if (hasLAF("windows", lafInfo)) { thrownew RuntimeException("On mac, but Windows is present");
}
// Make sure we have Aqua. if (!hasLAF("mac", lafInfo)) { thrownew RuntimeException("On mac and don't have Aqua");
}
} else { // Not windows and mac
// Make sure we don't have Windows. if (hasLAF("windows", lafInfo)) { thrownew RuntimeException("Not on windows and have Windows");
}
// Make sure we don't have Aqua. if (hasLAF("mac", lafInfo)) { thrownew RuntimeException("Not on mac and have Aqua");
}
// Make sure we have GTK. if (!hasLAF("gtk", lafInfo)) { thrownew RuntimeException( "Not on Windows and Mac and don't have GTK!");
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.