当前位置:首页 > 代码 > 正文

个人信息代码模板(个人信息电子版模板)

admin 发布:2022-12-19 17:38 183


本篇文章给大家谈谈个人信息代码模板,以及个人信息电子版模板对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。

本文目录一览:

用C#写一个输出个人基本信息的程序怎么写?像输出姓名、学号、性别等等这些的

大哥,你在忽悠人吗,这个你也问。

给你写一个模板吧。

先建立一个实体类

class userBean{

private String name;

//封装字段

public void setName(String name)

{this.name=name; }

public String getName()

{return name;}

}

//建立一个类,包含main方法,具体怎么写我忘了

class write{

public static void main(String arg[])

{

userBean user=new UserBean();//实例化一个userbean对象

uesr.setName("user");//可以看作是给你要输出的东西赋值吧。

console.writeln(uset.getName());

}

}

c#很多时候没碰了,但是大体应该是这样的,自己回去改改吧,这些都是很基础的,书上应该有,不应该是你的问题。

简单个人简历java录入程序 代码

我帮你写了那些JAVA代码了,效果包你满意!呵呵……

至于网页的代码嘛,这里就不贴了。你要的话HI我吧^_^。

JAVA代码如下:

import java.awt.BorderLayout;

import javax.swing.*;

import java.awt.Dimension;

import java.awt.Rectangle;

public class MyLuRu extends JFrame {

private static final long serialVersionUID = 1L;

private JPanel jContentPane = null;

private JLabel jLabel = null;

private JLabel jLabel1 = null;

private JLabel jLabel2 = null;

private JLabel jLabel3 = null;

private JTextField jTextField = null;

private JRadioButton jRadioButton = null;

private JRadioButton jRadioButton1 = null;

private JComboBox jComboBox = null;

private JComboBox jComboBox1 = null;

private JButton jButton = null;

private JButton jButton1 = null;

private JTextArea jTextArea = null;

private ButtonGroup mybg=new ButtonGroup();

/**

* This is the default constructor

*/

public MyLuRu() {

super();

initialize();

}

/**

* This method initializes this

*

* @return void

*/

private void initialize() {

this.setSize(268, 407);

this.setContentPane(getJContentPane());

this.setTitle("录入");

this.addWindowListener(new java.awt.event.WindowAdapter() {

public void windowClosing(java.awt.event.WindowEvent e) {

System.exit(0);

}

});

this.setVisible(true);

}

/**

* This method initializes jContentPane

*

* @return javax.swing.JPanel

*/

private JPanel getJContentPane() {

if (jContentPane == null) {

jLabel3 = new JLabel();

jLabel3.setBounds(new Rectangle(16, 150, 65, 18));

jLabel3.setText("文化程度:");

jLabel2 = new JLabel();

jLabel2.setBounds(new Rectangle(16, 108, 39, 18));

jLabel2.setText("专业:");

jLabel1 = new JLabel();

jLabel1.setBounds(new Rectangle(16, 66, 39, 18));

jLabel1.setText("性别:");

jLabel = new JLabel();

jLabel.setBounds(new Rectangle(16, 24, 39, 18));

jLabel.setText("姓名:");

jContentPane = new JPanel();

jContentPane.setLayout(null);

jContentPane.add(jLabel, null);

jContentPane.add(jLabel1, null);

jContentPane.add(jLabel2, null);

jContentPane.add(jLabel3, null);

jContentPane.add(getJTextField(), null);

jContentPane.add(getJRadioButton(), null);

jContentPane.add(getJRadioButton1(), null);

mybg.add(jRadioButton);

mybg.add(jRadioButton1);

jContentPane.add(getJComboBox(), null);

jContentPane.add(getJComboBox1(), null);

jContentPane.add(getJButton(), null);

jContentPane.add(getJButton1(), null);

jContentPane.add(getJTextArea(), null);

}

return jContentPane;

}

/**

* This method initializes jTextField

*

* @return javax.swing.JTextField

*/

private JTextField getJTextField() {

if (jTextField == null) {

jTextField = new JTextField();

jTextField.setBounds(new Rectangle(61, 24, 180, 18));

}

return jTextField;

}

/**

* This method initializes jRadioButton

*

* @return javax.swing.JRadioButton

*/

private JRadioButton getJRadioButton() {

if (jRadioButton == null) {

jRadioButton = new JRadioButton();

jRadioButton.setBounds(new Rectangle(61, 62, 38, 26));

jRadioButton.setText("男");

}

return jRadioButton;

}

/**

* This method initializes jRadioButton1

*

* @return javax.swing.JRadioButton

*/

private JRadioButton getJRadioButton1() {

if (jRadioButton1 == null) {

jRadioButton1 = new JRadioButton();

jRadioButton1.setBounds(new Rectangle(117, 62, 38, 26));

jRadioButton1.setText("女");

}

return jRadioButton1;

}

/**

* This method initializes jComboBox

*

* @return javax.swing.JComboBox

*/

private JComboBox getJComboBox() {

if (jComboBox == null) {

String[] strcb={"计算机","电子","工商"};

jComboBox = new JComboBox(strcb);

jComboBox.setBounds(new Rectangle(62, 108, 93, 18));

}

return jComboBox;

}

/**

* This method initializes jComboBox1

*

* @return javax.swing.JComboBox

*/

private JComboBox getJComboBox1() {

if (jComboBox1 == null) {

String[] strcb2={"大专","本科","硕士","博士"};

jComboBox1 = new JComboBox(strcb2);

jComboBox1.setBounds(new Rectangle(92, 150, 125, 18));

}

return jComboBox1;

}

/**

* This method initializes jButton

*

* @return javax.swing.JButton

*/

private JButton getJButton() {

if (jButton == null) {

jButton = new JButton();

jButton.setBounds(new Rectangle(66, 181, 60, 28));

jButton.setText("提交");

jButton.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent e) {

String strname=jTextField.getText();

String strsex="男";

if(jRadioButton1.isSelected()){

strsex="女";

}

String strzy=jComboBox.getSelectedItem().toString();

String strwh=jComboBox1.getSelectedItem().toString();

jTextArea.setText("姓名:"+strname+"\r\n"+"性别:"+strsex+"\r\n"+"专业:"+strzy+"\r\n"+"文化:"+strwh);

}

});

}

return jButton;

}

/**

* This method initializes jButton1

*

* @return javax.swing.JButton

*/

private JButton getJButton1() {

if (jButton1 == null) {

jButton1 = new JButton();

jButton1.setBounds(new Rectangle(158, 181, 60, 28));

jButton1.setText("取消");

jButton1.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent e) {

System.exit(0);

}

});

}

return jButton1;

}

/**

* This method initializes jTextArea

*

* @return javax.swing.JTextArea

*/

private JTextArea getJTextArea() {

if (jTextArea == null) {

jTextArea = new JTextArea();

jTextArea.setBounds(new Rectangle(16, 225, 229, 130));

}

return jTextArea;

}

public static void main(String args[]){

new MyLuRu();

}

}

效果如下图:

帮忙写下代码java swing,个人信息实例

本人急忙做的:有什么不合要求的请再告诉我:

package show;

import javax.swing.*;

import java.awt.*;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

public class Test extends JFrame implements ActionListener

{

GridBagLayout g=new GridBagLayout();

GridBagConstraints c=new GridBagConstraints();

Test(String str)

{

super(str);

setSize(300,500);

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

setLayout(g);

//调用方法

addComponent();

submit.addActionListener(this);

setVisible(true);

setLocationRelativeTo(null);//设居中显示;

}

//在这个方法中将会添加所有的组件;

//使用的网格包布局;希望楼主能看懂;

public void addComponent()

{

//个人信息登记

noteInformation=new JLabel("个人信息登记:");

add(g,c,noteInformation,0,0,1,1);

//用户名

userName=new JLabel("用户名:");

add(g,c,userName,0,1,1,1);

//用户名输入框

textUserName=new JTextField(10);

add(g,c,textUserName,1,1,2,1);

//密码:

password=new JLabel("密码:");

add(g,c,password,0,2,1,1);

//密码输入框

textUserPassword=new JTextField(10);

add(g,c,textUserPassword,1,2,2,1);

//性别

sex=new JLabel("性别:");

add(g,c,sex,0,3,1,1);

//男 女单选框

sexMan=new JRadioButton("男");

add(g,c,sexMan,1,3,1,1);

sexGirl=new JRadioButton("女");

add(g,c,sexGirl,2,3,1,1);

ButtonGroup group=new ButtonGroup();

group.add(sexMan);

group.add(sexGirl);

//出生日期

birthday=new JLabel("出生日期:");

add(g,c,birthday,0,4,1,1);

//复选框及其内容

String[] YEARS=new String[65];

for(int i=1950,k=0;i=2014;i++,k++)

{

YEARS[k]=i+"年";

}

year=new JComboBox(YEARS);

add(g,c,year,1,4,1,1);

//复选框及内容

month=new JComboBox(MONTH);

add(g,c,month,2,4,1,1);

//submit按钮

submit=new JButton("submit");

c.insets=new Insets(7,0,4,0);

add(g,c,submit,1,5,1,1);

result=new JTextArea(15,20);

add(g,c,result,0,6,3,4);

}

/* public void ActionPerformed(ActionEvent e)

{

String s=textUserName.getText();

String t=textUserPassword.getText();

String k=sexMan.getText();

String v=sexGirl.getText();

String a=(String) year.getSelectedItem();

String b=(String)month.getSelectedItem();

String num="用户名:"+s+"\n"+"密码: "+t+"性别: "+(k==null?v:k)+"\n"+"出生日期:"+a+" "+b;

result.append(num);

}*/

public void add(GridBagLayout g,GridBagConstraints c,JComponent jc,int x ,int y,int gw,int gh)

{

c.gridx=x;

c.gridy=y;

c.anchor=GridBagConstraints.WEST;

c.gridwidth=gw;

c.gridheight=gh;

g.setConstraints(jc,c);

add(jc);

}

public static void main(String args[])

{

new Test("个人信息登记表");

}

JLabel noteInformation,userName,password;

JLabel sex,birthday;

JTextField textUserName,textUserPassword;

JRadioButton sexMan,sexGirl;

JComboBox year,month;

JButton submit;

JTextArea result;

final String[] MONTH={"1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"};

@Override

public void actionPerformed(ActionEvent arg0)

{

String s=textUserName.getText();

String t=textUserPassword.getText();

String k=sexMan.getText();

String v=sexGirl.getText();

String a=(String) year.getSelectedItem();

String b=(String)month.getSelectedItem();

String num="用户名:"+s+"\n"+"密码: "+t+"\n 性别: "+(k==null?v:k)+"\n"+"出生日期:"+a+" "+b;

result.setText(num);

}

}

个人信息代码模板的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于个人信息电子版模板、个人信息代码模板的信息别忘了在本站进行查找喔。

版权说明:如非注明,本站文章均为 AH站长 原创,转载请注明出处和附带本文链接;

本文地址:http://ahzz.com.cn/post/15745.html


取消回复欢迎 发表评论:

分享到

温馨提示

下载成功了么?或者链接失效了?

联系我们反馈

立即下载