本文整理汇总了Java中javax.swing.JDialog.setDefaultLookAndFeelDecorated方法的典型用法代码示例。如果您正苦于以下问题:Java JDialog.setDefaultLookAndFeelDecorated方法的具体用法?Java JDialog.setDefaultLookAndFeelDecorated怎么用?Java JDialog.setDefaultLookAndFeelDecorated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JDialog
的用法示例。
在下文中一共展示了JDialog.setDefaultLookAndFeelDecorated方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import javax.swing.JDialog; //导入方法依赖的package包/类
public static void main(String[] args) {
UIManager.put("swing.boldMetal", Boolean.FALSE);
JDialog.setDefaultLookAndFeelDecorated(true);
JFrame.setDefaultLookAndFeelDecorated(true);
Toolkit.getDefaultToolkit().setDynamicLayout(true);
System.setProperty("sun.awt.noerasebackground", "true");
try {
UIManager.setLookAndFeel(new MetalLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
System.out.println(
"Metal Look & Feel not supported on this platform. \n"
+ "Program Terminated");
System.exit(0);
}
JFrame frame = new MetalworksFrame();
frame.setVisible(true);
}
示例2: ShowScreenCut
import javax.swing.JDialog; //导入方法依赖的package包/类
/**
* 调用此截图工具的应用程序未使用第三方皮肤时 nolnf=true 否则传false
*
* @param nolnf
*/
public static void ShowScreenCut(boolean nolnf) {
try {
if (nolnf) {
UIManager.setLookAndFeel(new NimbusLookAndFeel());
}
} catch (Exception ex) {
Logger.getLogger(ScreenCut.class.getName()).log(Level.SEVERE, null, ex);
}
JDialog.setDefaultLookAndFeelDecorated(false);
/* Create and display the dialog */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
ScreenCut dialog = new ScreenCut(new javax.swing.JFrame(), true);
dialog.addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(java.awt.event.WindowEvent e) {
System.exit(0);
}
});
dialog.setVisible(true);
}
});
}
示例3: initialize
import javax.swing.JDialog; //导入方法依赖的package包/类
public void initialize() throws Exception {
String skin = ObjectUtils.toString(config.get("UISkin")).trim();
String theme = ObjectUtils.toString(config.get("UITheme")).trim();
if(skin.equalsIgnoreCase("default")) //java default
return;
UIManager.setLookAndFeel(new SubstanceLookAndFeel());
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
if(StringUtils.isNotEmpty(theme))
SubstanceLookAndFeel.setCurrentTheme(theme);
else if(StringUtils.isNotEmpty(skin))
SubstanceLookAndFeel.setSkin((SubstanceSkin)newInstance(skin));
String watermark = ObjectUtils.toString(config.get("UIWatermark")).trim();
if(StringUtils.isNotEmpty(watermark))
SubstanceLookAndFeel.setCurrentWatermark((SubstanceWatermark)newInstance(watermark));
String buttonShaper = ObjectUtils.toString(config.get("UIButtonShaper")).trim();
if(StringUtils.isNotEmpty(buttonShaper))
SubstanceLookAndFeel.setCurrentButtonShaper((SubstanceButtonShaper)newInstance(buttonShaper));
String borderPainter = ObjectUtils.toString(config.get("UIBorderPainter")).trim();
if(StringUtils.isNotEmpty(borderPainter))
SubstanceLookAndFeel.setCurrentBorderPainter((SubstanceBorderPainter)newInstance(borderPainter));
String gradientPainter = ObjectUtils.toString(config.get("UIGradientPainter")).trim();
if(StringUtils.isNotEmpty(gradientPainter))
SubstanceLookAndFeel.setCurrentGradientPainter((SubstanceGradientPainter)newInstance(gradientPainter));
}
示例4: main
import javax.swing.JDialog; //导入方法依赖的package包/类
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/*
* Create and display the form
*/
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
SubstanceLookAndFeel.setSkin(new CremeCoffeeSkin());
MainFrame frame = new MainFrame();
frame.initActionPerform();
frame.initListSelectionListener();
frame.setVisible(true);
}
});
}
示例5: main
import javax.swing.JDialog; //导入方法依赖的package包/类
public static void main(String[] args) {
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
try {
UIManager.setLookAndFeel(new SubstanceOfficeBlue2007LookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
System.out.println(111);
initSetting();
MenuFrame.open();
}
示例6: dispose
import javax.swing.JDialog; //导入方法依赖的package包/类
/**
* 关闭遮罩层
*/
private void dispose() {
JDialog.setDefaultLookAndFeelDecorated(true);
if (dialog != null) {
dialog.dispose();
}
if (timer != null) {
timer.cancel();
}
}
示例7: dispose
import javax.swing.JDialog; //导入方法依赖的package包/类
@Override
public void dispose() {
JDialog.setDefaultLookAndFeelDecorated(true);
super.dispose();
}
示例8: SaveDialog
import javax.swing.JDialog; //导入方法依赖的package包/类
public SaveDialog(Song song){
this.song = song;
//Einstellungen am Dialogfenster
JDialog.setDefaultLookAndFeelDecorated(true);
setTitle("RMG-Songtitel wählen");
setLayout(new GridLayout(3,1));
setAlwaysOnTop(true);
setResizable(false);
setVisible(true);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
//oberste Zeile der Komponenten
northPanel = new JPanel(new GridLayout(1,2));
textLabel = new JLabel("Wähle einen Titel für das Stück:");
titleTextField = new JTextField();
northPanel.add(textLabel);
northPanel.add(titleTextField);
//mittlere Zeile der Komponenten
centerPanel = new JPanel(new FlowLayout());
fileTypLabel = new JLabel("Wähle die Dateitypen, in denen der Song gespeichert wird");
xmlBox = new JCheckBox("MusicXML");
xmlBox.setSelected(true);
midi0Box = new JCheckBox("MIDI Typ 0");
midi0Box.setSelected(false);
midi1Box = new JCheckBox("MIDI Typ 1");
midi1Box.setSelected(true);
centerPanel.add(fileTypLabel);
centerPanel.add(midi0Box);
centerPanel.add(midi1Box);
centerPanel.add(xmlBox);
//unterste Zeile der Komponenten
fileButton = new JButton("Fertig");
fileButton.addActionListener(new ActionHandler());
//Einfügen der oben erstellten Komponenten
add(northPanel);
add(centerPanel);
add(fileButton);
pack();
}
示例9: processSFR
import javax.swing.JDialog; //导入方法依赖的package包/类
/**
* other party send "SFR - Send File Request"
* asking me to receive the file,
* if I click yes, then other party should give me the file
* so, send GMF request to other party
* and start TCP thread to receive file
* @param msg
*/
private void processSFR(String msg) {
String l[] = msg.split("\\::");
String otherHost = l[0];
String filePath = l[1];
int fileSize = Integer.parseInt(l[2]);
System.out.println("File length: " + fileSize);
String otherIP = htblUsers.get(otherHost);
Path p = Paths.get(filePath);
String fileName = p.getFileName().toString();
//System.out.println("filePath = " + filePath);
//System.out.println("fileName = " + fileName);
JDialog.setDefaultLookAndFeelDecorated(true);
int response = JOptionPane.showConfirmDialog(null,
"Do you want to receive file from " + otherHost + " ?",
"Receive File: " + fileName,
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
if (response == JOptionPane.NO_OPTION) {
System.out.println("No button clicked");
Utils.sendUdpMsg("GMF" + myHost + "::" + "" + "::" + "No file", otherIP, Config.UDP_PORT);
} else if (response == JOptionPane.YES_OPTION) {
System.out.println("Yes button clicked");
// parent component of the dialog
JFrame parentFrame = new JFrame();
JFileChooser fileChooser = new JFileChooser();
fileChooser.setDialogTitle("Specify a file to save");
fileChooser.setSelectedFile(new File(System.getProperty("user.home") + File.separator + fileName) );
int userSelection = fileChooser.showSaveDialog(parentFrame);
if (userSelection == JFileChooser.APPROVE_OPTION) {
File fileToSave = fileChooser.getSelectedFile();
String savePath = fileToSave.getAbsolutePath();
System.out.println("Save as file: " + savePath);
Config.TCP_PORT++;
System.out.println("TCP Port : " + Config.TCP_PORT );
new ReceiveFileThread(Config.TCP_PORT, savePath, fileSize).start();
Utils.sendUdpMsg("GMF" + myHost + "::" + Config.TCP_PORT + "::" + filePath, otherIP, Config.UDP_PORT);
}
} else if (response == JOptionPane.CLOSED_OPTION) {
System.out.println("JOptionPane closed");
}
}