Making Form Applet And Adding Checkboxs On Java
What Will I Learn?
- You will learn how to create an applet
- You will learn how to create a form on java
- You will learn adding checkbox on form
Requirements
- Eclipse and java
- Knowledge of coding
Difficulty
- Basic
Description
This tutorial will help you to create a form and add checkboxs on your created form,also you will learn how to set background color with using setbackground.Also defining labels and using text fields is in the course.Finally you will learn how to create a button for your form applet.
Code Screenshots
import java.awt.*;
import java.applet.Applet;
@SuppressWarnings("serial")
public class applet extends Applet
{
public void init()
{
setBackground(Color.red);
Label lbname=new Label("name");
Label lbsurname=new Label("surname");
Label lbage=new Label("age");
Label lbgender=new Label("gender");
Label lbteam=new Label("team");
TextField txtname=new TextField();
TextField txtsurname=new TextField();
TextArea txtage=new TextArea(3,5);
CheckboxGroup cbgender=new CheckboxGroup();
Checkbox cbliverpool=new Checkbox("liverpool");
Checkbox cbbarcelona=new Checkbox("barcelona");
Checkbox cbjuventus=new Checkbox("juventus");
Button btnwrt=new Button("Send");
add(lbname);
add(txtname);
add(lbsurname);
add(txtsurname);
add(lbage);
add(txtage);
add(lbgender);
add(cbgender);
add(new Checkbox("Man",cbgender,true));
add(new Checkbox("Women",cbgender,false));
add(lbteam);
add(cbliverpool);
add(cbbarcelona);
add(cbjuventus);
add(btnwrt);
}
private void add(CheckboxGroup cbgender)
{
}
}
Hey @drewie I am @utopian-io. I have just upvoted you!
Achievements
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Thank you very much for the warning,fixed them.