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

📄 jrbutton.java

📁 详细讲解了java的基础知识
💻 JAVA
字号:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.border.*;
import java.awt.*;

public class JRButton extends JApplet
{
	
	public void init()
	{		
		Container contentPane = getContentPane();
		JPanel jpane1=new JPanel();		
		jpane1.setLayout(new FlowLayout());
		contentPane.add(jpane1,BorderLayout.CENTER);
		
		Icon icon1 = new ImageIcon("disk1.gif");
		Icon icon2 = new ImageIcon("disk2.gif");
		Icon icon3= new ImageIcon("disk3.gif");
		Icon icon4 = new ImageIcon("disk4.gif");
		
		JRadioButton[] radioButtons = new JRadioButton[] {
			new JRadioButton(),
			new JRadioButton(icon1),
			new JRadioButton(icon2, true),
			new JRadioButton("文字"),
			new JRadioButton("文字",true),
			new JRadioButton("文字",icon3),
			new JRadioButton("文字",icon4, false)
		};		
		
			

		for(int i=0; i < radioButtons.length; ++i) {
			radioButtons[i].setBorderPainted(true);
			jpane1.add(radioButtons[i]);
			
		}
		resize(500,150);
	}

	
}




⌨️ 快捷键说明

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