java代码出售 二手交易平台代码java

JAVA代码

public gongnengJF() {

成都创新互联公司专注为客户提供全方位的互联网综合服务,包含不限于做网站、网站制作、栾城网络推广、微信小程序定制开发、栾城网络营销、栾城企业策划、栾城品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们最大的嘉奖;成都创新互联公司为所有大学生创业者提供栾城建站搭建服务,24小时服务热线:18982081108,官方网址:www.cdcxhl.com

initComponents();

if(MessagePost.getUserPost().equals("职工")){

this.jMenuItem2.setEnabled(false);

里面initComponents什么意思setEnabled是什么?

/*

initComponents()

是你在使用GUI工具设计GUI界面时,NetBeans系统自动生成的方法。其功能是在界面添加各个组件,并为它们注册监听器。把initComponents()放在构造方法中,目的在于:在主类调用构造方法初始化时,完成了界面的绘制。

setEnabled(false)

是设置组件是否可用。

为false时,是不可用。

*/

private void jButton1MouseClicked(java.awt.event.MouseEvent evt) private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {

// TODO add your handling code here:

new pingcebumen().setVisible(true);

this.setVisible(false);

}

private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {

// TODO add your handling code here:

String newpwd=javax.swing.JOptionPane.showInputDialog(rootPane, "输入新密码");

String sql="update renyuanlist password ="+newpwd+"where username ='"+MessagePost.getUserName()+"'";

Database db = new Database();

db.executeDML(sql);

}

private void jMenuItem1MouseClicked(java.awt.event.MouseEvent evt) {

// TODO add your handling code here:

new ziliao().setVisible(true);

String newpwd = null;

String sql="select * from renyuanlist where password ="+newpwd+"where username ='"+MessagePost.getUserName()+"'";

}

private void jMenu1MouseClicked(java.awt.event.MouseEvent evt) {

// TODO add your handling code here:

new ziliao().setVisible(true);

}

/**

* @param args the command line arguments

*/

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

MessagePost.setUserPost("职工");

new gongnengJF().setVisible(true);

}

});

}

// Variables declaration - do not modify

//私有的成员属性,定义GUI图形界面的按钮,菜单等。

private javax.swing.JButton jButton1;

private javax.swing.JButton jButton2;

private javax.swing.JMenu jMenu1;

private javax.swing.JMenuBar jMenuBar1;

private javax.swing.JMenuItem jMenuItem1;

private javax.swing.JMenuItem jMenuItem2;

private javax.swing.JMenuItem jMenuItem3;

private javax.swing.JMenuItem jMenuItem4;

Swing是一组Java程序元件,它能够创建图象用户接口(GUI)元件,如按钮和滚动条,它们独立于特定操作系统的开窗口系统。Swing元件使用Java Foundation Classes(JFC)。

new gongnengJF().setVisible(true);

this.setVisible(false);

通过new 创建的对象,与this不是同一个对象。

鼠标监听事件,包括单击,双击等。。。

java实现简单的图书销售统计系统,要用GUI 求java高手帮忙 谢谢啦

我看到数据好像是保存在文件中的,这样解析很不给力。

建议使用 access 数据库,小巧又好用。

其他的这几个功能也不难,楼主,你哪里不会,你的思路是什么,可以讲一讲,可以协助你完成。

求一个简单的JAVA游戏代码,100行左右,谢谢!

import java.awt.Dimension;

import java.awt.Graphics;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import javax.swing.JButton;

import javax.swing.JFrame;

import javax.swing.JPanel;

public class Painter extends JFrame{

/**

*

*/

private static final long serialVersionUID = 8160427604782702376L;

CanvasPanel canvas = new CanvasPanel();;

public Painter() {

super("Star");

this.add(canvas);

this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

this.pack();

this.setResizable(false);

this.setLocationRelativeTo(null);

this.setVisible(true);

}

public static void main(String[] args) {

new Painter();

}

}

class CanvasPanel extends JPanel implements ActionListener{

/**

*

*/

private static final long serialVersionUID = -4642528854538741028L;

private JButton[] btn = new JButton[4];

private String[] btn_name = {"+", "-", "R", "L"};

private int center_x = 200, center_y = 200, radius = 100, degree = 0;

public CanvasPanel() {

this.setPreferredSize(new Dimension(400, 500));

this.setLayout(null);

for(int i = 0; i 4; i++) {

btn[i] = new JButton(btn_name[i]);

btn[i].setBounds(160 + i * 60, 425, 50, 50);

btn[i].addActionListener(this);

this.add(btn[i]);

}

}

@Override

public void paintComponent(Graphics g) {

super.paintComponent(g);

for(int i = 0; i 5; i++) {

g.drawLine( (int) (center_x + radius * Math.sin(Math.toRadians(degree + 72 * i))),

(int) (center_y - radius * Math.cos(Math.toRadians(degree + 72 * i))),

(int) (center_x + radius * Math.sin(Math.toRadians(degree + 72 * i + 144))),

(int) (center_y - radius * Math.cos(Math.toRadians(degree + 72 * i + 144))));

}

}

public void actionPerformed(ActionEvent e) {

// TODO Auto-generated method stub

if(e.getActionCommand() == "+") {

if(radius 200)

radius += 2;

repaint();

} else if(e.getActionCommand() == "-") {

if(radius 0)

radius -= 2;

repaint();

} else if(e.getActionCommand() == "R") {

degree = (degree + 2) % 360;

repaint();

} else if(e.getActionCommand() == "L") {

degree = (degree - 2) % 360;

repaint();

}

}

}

怎样交java源代码给老师

交java源代码给老师办法:

1、点击工程或者包节点,右键选择Export,类型选择Java-Jar。

2、选择要导出的文件或包,基本上不做修改。

3、可以设置你的MainClass,发给老师。

java如何检测源码二次倒卖

1、可以使用源代码监测软件进行检测,它能够快速扫描整个源码,并检测其中的可疑字符串,如果发现有任何可疑的字符串,就会发出警告。

2、源代码文件也可以使用特征哈希技术进行比对,它可以检测出源代码文件是否与其他文件相同,如果发现有不一致的情况,就可以判断是二次倒卖。

3、可以使用版权保护工具,它可以防止源代码被倒卖或者盗版,同时也可以追踪被倒卖的源码,以便及时发现二次倒卖的行为。

急求JAVA源代码,小游戏或者别的

//这是个聊天程序, 在ECLIPSE 运行 Client.java 就可以了。 连接是:localhost

//Server 代码,

package message;

import java.io.*;

import java.net.*;

import java.util.*;

public class Server {

public static void main(String[] args) throws Exception{

System.out.print("Server");

ServerSocket socket=new ServerSocket(8888);

Vector v=new Vector();

while(true){

Socket sk=socket.accept();

DataInputStream in=new DataInputStream(sk.getInputStream());

DataOutputStream out=new DataOutputStream(sk.getOutputStream());

v.add(sk);

new ServerThread(in,v).start();

}

}

}

//ServerThread.java 代码

package message;

import java.net.*;

import java.io.*;

import java.util.*;

public class ServerThread extends Thread{

DataInputStream in;

Vector all;

public ServerThread(DataInputStream in,Vector v){

this.in=in;

this.all=v;

}

public void run()

{

while(true)

{

try{

String s1=in.readUTF();

for(int i=0;iall.size();i++)

{

Object obj=all.get(i);

Socket socket=(Socket)obj;

DataOutputStream out=new DataOutputStream(socket.getOutputStream());

out.writeUTF(s1);

System.out.print(i);

out.flush();

}

System.out.print("Message send over!");

}catch(Exception e){e.printStackTrace();};

}

}

}

//ClientFrame.java 代码

package message;

import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

import java.net.*;

import java.io.*;

public class ClientFrame extends JFrame implements ActionListener{

JButton b1=new JButton ("SendMessage");

JButton b2=new JButton("Link Server");

JTextField t1=new JTextField(20);

JTextField t2=new JTextField(20);

JLabel l=new JLabel("输入服务器名字:");

JTextArea area=new JTextArea(10,20);

JPanel p1=new JPanel();

JPanel p2=new JPanel();

JPanel p3=new JPanel();

JPanel p4=new JPanel();

Socket socket;

public ClientFrame()

{

this.getContentPane().add(p1);

p2.add(new JScrollPane(area));

p3.add(t1);

p3.add(b1);

p4.add(l);

p4.add(t2);

p4.add(b2);

p2.setLayout(new FlowLayout());

p3.setLayout(new FlowLayout());

p4.setLayout(new FlowLayout());

p1.setLayout(new BorderLayout());

p1.add("North",p2);

p1.add("Center",p3);

p1.add("South",p4);

b1.addActionListener(this);

b2.addActionListener(this);

this.pack();

show();

}

public void actionPerformed(ActionEvent e)

{

if(e.getActionCommand().equals("Link Server"))

{

try{

socket=new Socket(t2.getText(),8888);

b2.setEnabled(false);

JOptionPane.showMessageDialog(this, "Connection Success");

DataInputStream in=new DataInputStream(socket.getInputStream());

new ClientThread(in,area).start();

}

catch(Exception e1){

JOptionPane.showMessageDialog(this, "Connection Error");

e1.printStackTrace();};

}

else if(e.getActionCommand().equals("SendMessage"))

{

try{

DataOutputStream out=new DataOutputStream(socket.getOutputStream());

out.writeUTF(t1.getText());

t1.setText("");

}catch(Exception e1){e1.printStackTrace();};

}

}

}

//ClientThread.java 代码

package message;

import java.net.*;

import java.io.*;

import javax.swing.*;

public class ClientThread extends Thread {

DataInputStream in;

JTextArea area;

public ClientThread(DataInputStream in,JTextArea area){

this.in=in;

this.area=area;

}

public void run()

{

while(true){

try{

String s=in.readUTF();

area.append(s);

}

catch(Exception e){e.printStackTrace();};

}

}

}

//Client.java代码

package message;

public class Client {

/**

* @param args

*/

public static void main(String[] args) {

new ClientFrame();

}

}

// 每段代码都是个类,不要弄在一个文件里。 运行 Client.java

good luck to you!


本文名称:java代码出售 二手交易平台代码java
分享网址:http://bzwzjz.com/article/dosophh.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 成都品牌网站建设 网站制作 外贸网站设计方案 营销型网站建设 成都网站建设 高端网站设计 商城网站建设 成都网站制作 成都企业网站建设 成都网站建设 重庆网站建设 企业网站建设 成都网站设计 成都网站设计 成都定制网站建设 成都网站建设 成都模版网站建设 企业网站设计 重庆网站建设 响应式网站设计 外贸网站建设 响应式网站设计