⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 localcolor.java

📁 这是我们写的考试系统!!java编写的!!不是很大!!希望有用
💻 JAVA
字号:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class LocalColor{
	
	public static void main(String[] args){
		
		final JFrame frame=new JFrame("LocalColor");
		final Container content=frame.getContentPane();
		
		content.setLayout(new GridBagLayout());
		JButton button=new JButton("Change color...");
		content.add(button);
		
		button.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				Color c=JColorChooser.showDialog(frame,"Choose a color",content.getBackground());
				if(c!=null)  content.setBackground(c);
				
			}
			
		});
		
		frame.setSize(300,300);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setVisible(true);
		
	}
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -