swing jbutton中字体不清晰,怎样更改jbutton中字体及颜色呢? hehe,UIManager改改缺生的字体设置就可以啦,从BOLD改到PLAIN,不知为什么,粗体字总显示不好 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 import javax.swing.*;import java.awt.*;import java.awt.event.*;public class SamplePopup { public static void main(String args[]) { JFrame frame = new JFrame("Sample Popup"); JButton button = new JButton ("Ask"); Font f = new Font("Monospaced", Font.BOLD, 24); UIManager.put("Label.font", f); ActionListener actionListener = new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { Component source = (Component)actionEvent.getSource(); Object response = JOptionPane.showInputDialog( source, "Where would you like to go to lunch?", "Select a Destination", JOptionPane.QUESTION_MESSAGE, null, new String[] { "Burger King", "McDonalds", "Pizza Hut", "Taco Bell", "Wendy's"}, "McDonalds"); System.out.println ("Response: " + response); } }; button.addActionListener(actionListener); Container contentPane = frame.getContentPane(); contentPane.add(button, BorderLayout.SOUTH); frame.setSize(300, 200); frame.setVisible(true); }} JVAV 读取6万条数据,怎么上了600M的内存?----求大神指教 关于JAVA中求数的问题 在线等 非初学者的初级问题 java实现Integer.parseInt()? servlet的中文乱码 把类声明为abstract意味着什么? 在jb9中如何把一个java程序编译成一个windows应用程序 初学JAVA 怎样编译JAVA文件(做了一个sample.java文件,不知道怎样编译) 请问如何用Java从Oracle数据库中读取媒体文件,如图片,mpeg 等 Jbuilder6 問題 一个企业级的系统解决方案征集!!! 在系统剪贴板中,能否放置多层内容?
import java.awt.*;
import java.awt.event.*;public class SamplePopup {
public static void main(String args[]) { JFrame frame = new JFrame("Sample Popup");
JButton button = new JButton ("Ask");
Font f = new Font("Monospaced", Font.BOLD, 24);
UIManager.put("Label.font", f);
ActionListener actionListener = new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
Component source = (Component)actionEvent.getSource();
Object response = JOptionPane.showInputDialog(
source,
"Where would you like to go to lunch?",
"Select a Destination",
JOptionPane.QUESTION_MESSAGE,
null,
new String[] {
"Burger King",
"McDonalds",
"Pizza Hut",
"Taco Bell",
"Wendy's"},
"McDonalds");
System.out.println ("Response: " + response);
}
};
button.addActionListener(actionListener);
Container contentPane = frame.getContentPane();
contentPane.add(button, BorderLayout.SOUTH);
frame.setSize(300, 200);
frame.setVisible(true);
}
}