1.你好,项目项目可以麻烦你帮我写个实现下功能的源码java源码吗,谢谢(ps:我的创建U启源码财富值是零,实在抱歉...)
2.java课程设计源代码(急!报错!项目项目狗扑源码 密码!源码开源 公开源码!创建)
你好,报错可以麻烦你帮我写个实现下功能的项目项目java源码吗,谢谢(ps:我的源码财富值是零,实在抱歉...)
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ButtonGroup;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
/
***
* @author kaifang
* @date 年月日下午5::
*/
public class TestGUI {
private static JTextField textField;
private static JTextField textField_1;
public static void main(String[] args) {
JFrame f = new JFrame("A JFrame");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(,创建 );
f.setLocation(, );
f.getContentPane().setLayout(null);
JLabel lblNewLabel = new JLabel("\uD3\uD");
lblNewLabel.setBounds(, , , );
f.getContentPane().add(lblNewLabel);
JLabel lblNewLabel_1 = new JLabel("\u5E\u9F");
lblNewLabel_1.setBounds(, , , );
f.getContentPane().add(lblNewLabel_1);
textField = new JTextField();
textField.setBounds(, , , );
f.getContentPane().add(textField);
textField.setColumns();
textField_1 = new JTextField();
textField_1.setBounds(, , , );
f.getContentPane().add(textField_1);
textField_1.setColumns();
JLabel lblNewLabel_2 = new JLabel("\u\uB");
lblNewLabel_2.setBounds(, , , );
f.getContentPane().add(lblNewLabel_2);
JRadioButton rdbtnN = new JRadioButton("\u");
rdbtnN.setBounds(, , , );
f.getContentPane().add(rdbtnN);
JRadioButton radioButton = new JRadioButton("\u");
radioButton.setBounds(, , , );
f.getContentPane().add(radioButton);
ButtonGroup bg = new ButtonGroup();
bg.add(rdbtnN);
bg.add(radioButton);
JLabel label = new JLabel("\uC5\uF");
label.setBounds(, , , );
f.getContentPane().add(label);
JCheckBox chckbxJava = new JCheckBox("Java");
chckbxJava.setBounds(, , , );
f.getContentPane().add(chckbxJava);
JCheckBox chckbxC = new JCheckBox("C");
chckbxC.setBounds(, , , );
f.getContentPane().add(chckbxC);
JLabel label_1 = new JLabel("\uEA\u\u4ECB\u7ECD");
label_1.setBounds(, , , );
f.getContentPane().add(label_1);
JScrollPane scroll = new JScrollPane();
scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
scroll.setBounds(, , , );
f.getContentPane().add(scroll);
JTextArea textArea = new JTextArea();
scroll.setViewportView(textArea);
JButton btnNewButton = new JButton("\uE\u5B9A");
btnNewButton.setBounds(, , , );
f.getContentPane().add(btnNewButton);
JButton btnNewButton_1 = new JButton("\uD6\u6D");
btnNewButton_1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
});
btnNewButton_1.setBounds(, , , );
f.getContentPane().add(btnNewButton_1);
JLabel lblNewLabel_3 = new JLabel("");
lblNewLabel_3.setIcon(new ImageIcon("C:\\Users\\Administrator\\Pictures\\_.jpg"));
lblNewLabel_3.setBounds(, , , );
f.getContentPane().add(lblNewLabel_3);
f.setVisible(true);
}
}
java课程设计源代码(急!!报错!项目项目android 文件浏览 源码!源码)
import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.SwingConstants;
import javax.swing.border.LineBorder;
public class game extends JFrame {
private JLabel label_2;
private int number;
private int sum;
final JLabel label = new JLabel();
final JLabel label_1 = new JLabel();
public static void main(String[] args) {
new game();
}
public game() {
super("点?!创建搭建源码卡盟");
getContentPane().setLayout(null);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
final JButton button = new JButton();
button.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent arg0) {
onClick();
}
});
button.setText("出牌");
button.setBounds(, , , );
getContentPane().add(button);
label.setBorder(new LineBorder(Color.black, 1, false));
label.setHorizontalAlignment(SwingConstants.CENTER);
label.setFont(new Font("", Font.BOLD, ));
label.setText("背面");
label.setBounds(, , , );
getContentPane().add(label);
label_1.setText("你已经拥有的牌:");
label_1.setBounds(, , , );
getContentPane().add(label_1);
this.setBounds(, , , );
this.setVisible(true);
getContentPane().add(getLabel_2());
}
public int randNumber() {
try {
Thread.sleep();
} catch (InterruptedException e) {
e.printStackTrace();
}
return (int) (Math.random() * + 1);
}
public void onClick() {
number = this.randNumber();
this.sum += number;
label.setText("" + number);
String strTemp = this.label_1.getText();
strTemp += "" + number + " ";
label_1.setText(strTemp);
String temp = "合计:" + sum;
label_2.setText(temp);
isWin();
}
public void isWin() {
if (sum > ) {
JOptionPane.showMessageDialog(this, "你输了");
clear();
return;
} else if (sum == ) {
JOptionPane.showMessageDialog(this, "你赢了");
clear();
return;
} else {
int i = JOptionPane.showOptionDialog(this, "是否继续?", "提示",
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.INFORMATION_MESSAGE, null, null, null);
if (i == JOptionPane.OK_OPTION) {
onClick();
} else
return;
}
}
private void clear() {
label_2.setText("合计:");
sum = 0;
number = 0;
label_1.setText("你已经拥有的牌:");
}
/
*** @return
*/
protected JLabel getLabel_2() {
if (label_2 == null) {
label_2 = new JLabel();
label_2.setText("合计:");
label_2.setBounds(, , , );
}
return label_2;
}
}
真好无聊中。。
2024-11-29 23:201717人浏览
2024-11-29 23:132589人浏览
2024-11-29 22:341395人浏览
2024-11-29 22:27740人浏览
2024-11-29 20:53885人浏览
2024-11-29 20:511063人浏览
1.最新仿易企秀V15.1完整版开源版源码介绍_最新仿易企秀V15.1完整版开源版源码是什么2.求一个基于Java编写的医院预约系统源码3.PHP源码_最新同城上门家政按摩H5小程序源码_上门预约系统
1.有没有人知道网站的源代码吗,可是听人说有些网络设计公司只给客户一些套代码,建成的网站也不能出售转让2.简信CRM:免费开源CRM系统的优缺点?3.网站源码与模板及网站管理系统区别与关系4.C/S架
1.如何使用PHP显示在线Word文档2.前端开发中提到的“脚手架”到底指什么,CLI如何使用PHP显示在线Word文档 php 在线预览 word 文档,有多种方法,本质上来说,大多是调用客户端