本文整理汇总了Java中javax.swing.SwingUtilities.updateComponentTreeUI方法的典型用法代码示例。如果您正苦于以下问题:Java SwingUtilities.updateComponentTreeUI方法的具体用法?Java SwingUtilities.updateComponentTreeUI怎么用?Java SwingUtilities.updateComponentTreeUI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.SwingUtilities
的用法示例。
在下文中一共展示了SwingUtilities.updateComponentTreeUI方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createConnection
import javax.swing.SwingUtilities; //导入方法依赖的package包/类
public static Connection createConnection(JFrame owner, String title) {
ConnectionDialogSwing dialog = new ConnectionDialogSwing(owner,
title);
// Added: ([email protected]) Default LAF of Native
try {
// UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
SwingUtilities.updateComponentTreeUI(dialog);
} catch (Exception e) {
CommonSwing.errorMessage(e);
}
dialog.create();
return dialog.mConnection;
}
示例2: setLookAndFeel
import javax.swing.SwingUtilities; //导入方法依赖的package包/类
/**
* Sets the look and feel of the JDialog similar to the main application window.
*/
private void setLookAndFeel() {
String lnfClassName = Application.getGlobalInfo().getAppLookAndFeelClassName();
if (lnfClassName==null) return;
String currLookAndFeelClassName = UIManager.getLookAndFeel().getClass().getName();
if (lnfClassName.equals(currLookAndFeelClassName)==true) return;
try {
UIManager.setLookAndFeel(lnfClassName);
SwingUtilities.updateComponentTreeUI(this);
} catch (Exception e) {
System.err.println("Cannot install " + lnfClassName + " on this platform:" + e.getMessage());
}
}
示例3: updateWindowTreeUI
import javax.swing.SwingUtilities; //导入方法依赖的package包/类
private static void updateWindowTreeUI(Window window) {
SwingUtilities.updateComponentTreeUI(window);
Window[] arrwindow = window.getOwnedWindows();
int n = arrwindow.length;
while (--n >= 0) {
Window window2 = arrwindow[n];
if (!window2.isDisplayable()) continue;
Test4319113.updateWindowTreeUI(window2);
}
}
示例4: doLookAndFeel
import javax.swing.SwingUtilities; //导入方法依赖的package包/类
/**
* This method applies the look and feel stored in a user preference.
* Default look and feel for Mac and Windows computers is "Native", and for
* other is "Cross-platform".
*/
private Runner doLookAndFeel() {
if (wrap)
return wrapMe();
try {
if ("Native".equals(LAF.get())) {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} else {
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
}
SwingUtilities.updateComponentTreeUI(frame);
SwingUtilities.updateComponentTreeUI(prefDialog);
SwingUtilities.updateComponentTreeUI(viz.getFrame());
} catch (Throwable e) {}
return null;
}
示例5: setLookAndFeel
import javax.swing.SwingUtilities; //导入方法依赖的package包/类
/**
* This method set the Look and Feel of this Dialog.
* @param newLnF the new look and feel
*/
private void setLookAndFeel() {
String lnfClassName = Application.getGlobalInfo().getAppLookAndFeelClassName();
if (lnfClassName==null) return;
String currLookAndFeelClassName = UIManager.getLookAndFeel().getClass().getName();
if (lnfClassName.equals(currLookAndFeelClassName)==true) return;
try {
UIManager.setLookAndFeel(lnfClassName);
SwingUtilities.updateComponentTreeUI(this);
} catch (Exception e) {
System.err.println("Cannot install " + lnfClassName + " on this platform: " + e.getMessage());
}
}
示例6: setLookAndFeel
import javax.swing.SwingUtilities; //导入方法依赖的package包/类
/**
*
*/
public void setLookAndFeel(String clazz)
{
JFrame frame = (JFrame) SwingUtilities.windowForComponent(this);
if (frame != null)
{
try
{
UIManager.setLookAndFeel(clazz);
SwingUtilities.updateComponentTreeUI(frame);
// Needs to assign the key bindings again
keyboardHandler = new EditorKeyboardHandler(graphComponent);
}
catch (Exception e1)
{
e1.printStackTrace();
}
}
}
示例7: setLookAndFeel
import javax.swing.SwingUtilities; //导入方法依赖的package包/类
/**
* Sets the look and feel of the dialog similar to the current application window
*/
private void setLookAndFeel() {
// --- Some exit options --------------------------
if (this.lookAndFeelClassName==null) return;
String currLookAndFeelClassName = UIManager.getLookAndFeel().getClass().getName();
if (this.lookAndFeelClassName.equals(currLookAndFeelClassName)==true) return;
// --- Try to set the look and feel ---------------
try {
UIManager.setLookAndFeel(this.lookAndFeelClassName);
SwingUtilities.updateComponentTreeUI(this.getProgressMonitorContainer());
} catch (Exception ex) {
System.err.println("Cannot install " + this.lookAndFeelClassName + " on this platform:" + ex.getMessage());
}
}
示例8: setSwingLAF
import javax.swing.SwingUtilities; //导入方法依赖的package包/类
static void setSwingLAF(java.awt.Component comp, String targetTheme) {
try {
if (targetTheme.equalsIgnoreCase(Native)) {
UIManager.setLookAndFeel(
UIManager.getSystemLookAndFeelClassName());
} else if (targetTheme.equalsIgnoreCase(Java)) {
UIManager.setLookAndFeel(
UIManager.getCrossPlatformLookAndFeelClassName());
} else if (targetTheme.equalsIgnoreCase(Motif)) {
UIManager.setLookAndFeel(
"com.sun.java.swing.plaf.motif.MotifLookAndFeel");
}
// if (targetTheme.equalsIgnoreCase(plaf)){
// UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
// }
//
// if (targetTheme.equalsIgnoreCase(GTK)){
// UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
// }
SwingUtilities.updateComponentTreeUI(comp);
if (comp instanceof java.awt.Frame) {
((java.awt.Frame) comp).pack();
}
} catch (Exception e) {
errorMessage(e);
}
}
示例9: doTest
import javax.swing.SwingUtilities; //导入方法依赖的package包/类
private static void doTest() {
/*
* Calling updateComponentTreeUI creates a new FormView instance with
* its own associated JButton instance. The same DefaultButtonModel
* instance is used for both FormView's.
*
* The action listeners associated with (the JButton for) the first
* FormView should be unregistered from this common DefaultButtonModel,
* such that only those for the new FormView remain.
*/
SwingUtilities.updateComponentTreeUI(html);
}
示例10: run
import javax.swing.SwingUtilities; //导入方法依赖的package包/类
public synchronized void run() {
if (this.chooser == null) {
this.chooser = new JColorChooser();
JFrame frame = new JFrame(getClass().getName());
frame.add(this.chooser);
frame.setVisible(true);
}
else if (this.updated) {
if (isShowing(this.chooser.getPreviewPanel())) {
exit("custom preview panel is showing");
}
exit(null);
}
else {
Component component = this.chooser.getPreviewPanel();
if (component == null) {
component = getPreview(this.chooser);
}
if (!isShowing(component)) {
exit("default preview panel is not showing");
}
this.updated = true;
this.chooser.setPreviewPanel(new JPanel());
}
LookAndFeelInfo[] infos = UIManager.getInstalledLookAndFeels();
LookAndFeelInfo info = infos[++this.index % infos.length];
try {
UIManager.setLookAndFeel(info.getClassName());
}
catch (Exception exception) {
exit("could not change L&F");
}
SwingUtilities.updateComponentTreeUI(this.chooser);
SwingUtilities.invokeLater(this);
}
示例11: run
import javax.swing.SwingUtilities; //导入方法依赖的package包/类
public void run() {
if (this.infos == null) {
this.infos = UIManager.getInstalledLookAndFeels();
Thread.currentThread().setUncaughtExceptionHandler(this);
JPanel panel = new JPanel();
panel.setBorder(this);
this.frame = new JFrame(getClass().getSimpleName());
this.frame.add(panel);
this.frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
this.frame.setVisible(true);
}
if (this.index == this.infos.length) {
this.frame.dispose();
}
else {
LookAndFeelInfo info = this.infos[this.index % this.infos.length];
try {
UIManager.setLookAndFeel(info.getClassName());
}
catch (Exception exception) {
System.err.println("could not change look and feel");
}
SwingUtilities.updateComponentTreeUI(this.frame);
this.frame.pack();
this.frame.setLocationRelativeTo(null);
this.index++;
SwingUtilities.invokeLater(this);
}
}
示例12: updateUI
import javax.swing.SwingUtilities; //导入方法依赖的package包/类
/**
* Called by the parent completion popup window the LookAndFeel is updated.
*/
public void updateUI() {
SwingUtilities.updateComponentTreeUI(this);
// Update editor pane for new font, bg, selection colors, etc.
TipUtil.tweakTipEditorPane(descArea);
scrollPane.setBackground(descArea.getBackground());
scrollPane.getViewport().setBackground(descArea.getBackground());
((JPanel)getContentPane()).setBorder(TipUtil.getToolTipBorder());
}
示例13: updateFrames
import javax.swing.SwingUtilities; //导入方法依赖的package包/类
public void updateFrames() {
SwingUtilities.updateComponentTreeUI(this);
if(sendForm != null) SwingUtilities.updateComponentTreeUI(sendForm);
if(receiveForm != null) SwingUtilities.updateComponentTreeUI(receiveForm);
if(settingsForm != null) SwingUtilities.updateComponentTreeUI(settingsForm);
if(helpForm != null) SwingUtilities.updateComponentTreeUI(helpForm);
}
示例14: TranslucentShapedFrameTest
import javax.swing.SwingUtilities; //导入方法依赖的package包/类
/**
* Creates new form TranslucentShapedFrameTest
*/
public TranslucentShapedFrameTest() {
// not necessary, but we just look nicer
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception ex) {}
initComponents();
checkEffects();
SwingUtilities.updateComponentTreeUI(this);
}
示例15: actionPerformed
import javax.swing.SwingUtilities; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent e) {
String cmd = e.getActionCommand();
String plaf_name = null;
if(cmd.equals("Load")) {
String f = chooseFile();
if(f != null) {
f = f.replace('\\', '/');
consoleTextArea.eval("load(\"" + f + "\");");
}
} else if(cmd.equals("Exit")) {
System.exit(0);
} else if(cmd.equals("Cut")) {
consoleTextArea.cut();
} else if(cmd.equals("Copy")) {
consoleTextArea.copy();
} else if(cmd.equals("Paste")) {
consoleTextArea.paste();
} else {
if(cmd.equals("Metal")) {
plaf_name = "javax.swing.plaf.metal.MetalLookAndFeel";
} else if(cmd.equals("Windows")) {
plaf_name = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
} else if(cmd.equals("Motif")) {
plaf_name = "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
}
if(plaf_name != null) {
try {
UIManager.setLookAndFeel(plaf_name);
SwingUtilities.updateComponentTreeUI(this);
consoleTextArea.postUpdateUI();
// updateComponentTreeUI seems to mess up the file
// chooser dialog, so just create a new one
createFileChooser();
} catch(Exception exc) {
JOptionPane.showMessageDialog(this,
exc.getMessage(),
"Platform",
JOptionPane.ERROR_MESSAGE);
}
}
}
}