用Java实现电子展板(电子展板怎么制作)
用java设计一个简单的界面设计,越简单越好,谢谢
用java设计一个简单的界面可以参考如下实例:
import?javax.swing.JFrame;//框架
import?javax.swing.JPanel;//面板
import?javax.swing.JButton;//按钮
import?javax.swing.JLabel;//标签
import?javax.swing.JTextField;//文本框
import?java.awt.Font;//字体
import?java.awt.Color;//颜色
import?javax.swing.JPasswordField;//密码框
import?java.awt.event.ActionListener;//事件监听
import?java.awt.event.ActionEvent;//事件处理
import?javax.swing.JOptionPane;//消息窗口public?class?UserLogIn?extends?JFrame{
?public?JPanel?pnluser;
?public?JLabel?lbluserLogIn;
?public?JLabel?lbluserName;
?public?JLabel?lbluserPWD;
?public?JTextField?txtName;
?public?JPasswordField?pwdPwd;
?public?JButton?btnSub;
?public?JButton?btnReset;
?public?UserLogIn(){
??pnluser?=?new?JPanel();
??lbluserLogIn?=?new?JLabel();
??lbluserName?=?new?JLabel();
??lbluserPWD?=?new?JLabel();
??txtName?=?new?JTextField();
??pwdPwd?=?new?JPasswordField();
??btnSub?=?new?JButton();
??btnReset?=?new?JButton();
??userInit();
?}
?public?void?userInit(){
??this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//设置关闭框架的同时结束程序
??this.setSize(300,200);//设置框架大小为长300,宽200
??this.setResizable(false);//设置框架不可以改变大小
??this.setTitle("用户登录");//设置框架标题
??this.pnluser.setLayout(null);//设置面板布局管理
??this.pnluser.setBackground(Color.cyan);//设置面板背景颜色
??this.lbluserLogIn.setText("用户登录");//设置标签标题
??this.lbluserLogIn.setFont(new?Font("宋体",Font.BOLD?|?Font.ITALIC,14));//设置标签字体
??this.lbluserLogIn.setForeground(Color.RED);//设置标签字体颜色
??this.lbluserName.setText("用户名:");
??this.lbluserPWD.setText("密????码:");
??this.btnSub.setText("登录");
??this.btnReset.setText("重置");
??this.lbluserLogIn.setBounds(120,15,60,20);//设置标签x坐标120,y坐标15,长60,宽20
??this.lbluserName.setBounds(50,55,60,20);
??this.lbluserPWD.setBounds(50,85,60,25);
??this.txtName.setBounds(110,55,120,20);
??this.pwdPwd.setBounds(110,85,120,20);
??this.btnSub.setBounds(85,120,60,20);
??this.btnSub.addActionListener(new?ActionListener()//匿名类实现ActionListener接口
???{
????public?void?actionPerformed(ActionEvent?e){
?????btnsub_ActionEvent(e);
????}????
???}
??);?
??this.btnReset.setBounds(155,120,60,20);
??this.btnReset.addActionListener(new?ActionListener()//匿名类实现ActionListener接口
???{
????public?void?actionPerformed(ActionEvent?e){
?????btnreset_ActionEvent(e);
????}????
???}
??);???
??this.pnluser.add(lbluserLogIn);//加载标签到面板
??this.pnluser.add(lbluserName);
??this.pnluser.add(lbluserPWD);
??this.pnluser.add(txtName);
??this.pnluser.add(pwdPwd);
??this.pnluser.add(btnSub);
??this.pnluser.add(btnReset);
??this.add(pnluser);//加载面板到框架
??this.setVisible(true);//设置框架可显??
?}
?public?void?btnsub_ActionEvent(ActionEvent?e){
??String?name?=?txtName.getText();
??String?pwd?=?String.valueOf(pwdPwd.getPassword());
??if(name.equals("")){
???JOptionPane.showMessageDialog(null,"账号不能为空","错误",JOptionPane.ERROR_MESSAGE);
???return;
??}else?if?(pwd.equals("")){
???JOptionPane.showMessageDialog(null,"密码不能为空","错误",JOptionPane.ERROR_MESSAGE);
???return;
??}else?if(true){
???this.dispose();
??}else{
???JOptionPane.showMessageDialog(null,"账号或密码错误","错误",JOptionPane.ERROR_MESSAGE);
???return;
??}
?}
?public?void?btnreset_ActionEvent(ActionEvent?e){
??txtName.setText("");
??pwdPwd.setText("");
?}
?public?static?void?main(String[]?args){
??new?UserLogIn();
?}
}

求助高手用java编写一个用于网络教学的电子白板
我这里有,不过怎么能在这里留下。别人是不会把代码留到这里的。我还可以给你介绍个人他哪里也有QQ 42396542 祝你好运了。呵呵。。
用JAVA在界面中实现幻灯片播放,求代码
要让照片随机播放,需要把照片名改成比如photo1.jpg,photo2.jpg,photo3.jpg...的有序号顺序排列的文件名,
然后把改名后的照片文件放到你的项目名的目录下,比如你的项目名叫"slideshow",你就把照片文件放到slideshow文件夹下.
最后把下面的Java程序拷贝到你的项目中,把有DD类名的地方改成你的类名,就行了.
完整的让一些照片在JFrame窗体里自动随机播放的幻灯片程序如下
(我用的图片文件是photo1.jpg,photo2.jpg,photo3.jpg,注意事项在注释中注明
import java.awt.Graphics;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
public class DD extends JFrame implements Runnable{
ImageIcon ii=new ImageIcon("photo1.jpg");//这里换成你的图片文件名,放在你的项目名的文件夹中
DD(){
super("Slide");
setSize(400, 400);
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public void paint(Graphics g){
super.paint(g);
g.drawImage(ii.getImage(),0,0,400,400,null);
}
@Override
public void run() {
while(true){
try {
Thread.sleep(500);//这里是幻灯片播放间隔的时间,这里为500毫秒=0.5秒
} catch (InterruptedException e) {
e.printStackTrace();
}
int i=(int)(Math.random()*3)+1;//这里是产生从1-3的随机数,如果你有6个图片文件,把3改成6就是从1-6的随机数了.
ii=new ImageIcon("photo"+i+".jpg");//这里调用你的图片文件,如果你有6个图片文件,改成从1-6的文件名方便调用
this.repaint();
}
}
public static void main(String[] args) {
DD d=new DD();
Thread t=new Thread(d);
t.start();
}
}
javaweb平面图怎么实现
javaweb平面图实现的话需要用java的applet即可。
拓展资料:
(IDEA和Eclipse上均可运行)
设计一个简易地图(类似房间平面图),图上标有多个检测区域(下面已标注要检测哪五个),区域上显示当前的检测数值和状态(红,黄,绿)。
点击检测区域,弹出对话框,对话框中内容包括:
检测数值的实时曲线,可能有多个(实时的意思是要显示检测区域部分的后端数据,以echarts的曲线图形式展示)
同时,也可以用表格的方式,显示上述检测数值,同时表格数据可以导出EXCEL格式文件
检测区域的对话框可以同时显示(非模态方式),也可以只能单一显示(模态方式)(不使用数据库调用,只用表格)
客户端的所有请求(如:温度等的数值记录)都通过服务端的TOMCAT上的java程序实现4.服务端编写所有请求的实现过程,以JSON格式方式返回请求内容
多行显示不同的检测内容,把状态按钮调到每行的前面作为各自的状态(红黄绿三种)。
检测区域:
厨房:一氧化碳浓度,温度
主卧:温度,湿度,噪声
阳台:温度,湿度,风力
餐厅:温度,湿度,光亮
主卫:温度,湿度