Tutorial Basic - How To Create Frame Controls On Java Programming

in #utopian-io7 years ago (edited)

What Will I Learn?

  • You will learn about java programming language
  • You will learn about Frame Control
  • You will learn to create a GUI app view
  • You will learn about components and containers

Requirements

  • You need a strong intention in the learning process
  • You need basic java programming
  • You need insight on Awt and String
  • You need a basic GUI app

Difficulty

  • Basic

Tutorial Contents

On this occasion I will give tutorial to my friends all how to create Frame Control contained in GUI application, if you want to make Frame Control correctly then you should follow the steps below in a phased:

  • The first step you should create a file in your text editor respectively and save the first file you will create in the format (java) and at this time the author create a file named FrameWControls.java

  • The second step is the syntax field that the author will share to all of you and each syntax that the author gives will be explained in phases in the process of making frame control, and the syntax below:

In the syntax below is a declaration process that will be called by java programming to awt and next is the process of making the class according to the file that is in the save at the beginning and also the process call frame controls that will be created in the next syntax

import java.awt. *;
public class FrameWControls extends Frame {
public FrameWControls () {}

In the syntax below as the start of the initial stage in the frame control and which will be created first is the layout serves as a frame control and fwc.setSize (500,400); functions as a size control for the next layout of the button making in the syntax fwc.add (new Button ("Hi Utopian Friend")); and for the label fwc.add (new Label (" Approved ")); subsequent creation of writing columns can be contained in the syntax fwc.add (new TextField ());

public static void main (String args [])
{
FrameWControls fwc = new FrameWControls ();
fwc.setLayout (new FlowLayout ());
fwc.setSize (400, 850);
fwc.add (new Button ("Hi Utopian Friend"));
fwc.add (new Label ("Approved"));
fwc.add (new TextField ());

In the syntax below serves as the creation of all boxes in united in a group and the first syntax is the function call for making CheckboxGroup then making the first check box is shown in syntax fwc.add (new Checkbox (" first ", cbg, true )); containing the text beside it is first and for the second and third check boxes the same as the first check box making syntax just the author replace the existing text on each check box made.

CheckboxGroup cbg = new CheckboxGroup();
fwc.add(new Checkbox("first", cbg, true));  
fwc.add(new Checkbox("second", cbg, false));
fwc.add(new Checkbox("third", cbg, true));

In the syntax below is the advanced check box group and the reason why the author loads True and False syntax on the previous syntax is that the above syntax has a relationship with the syntax below that is as a list creation add selected by the author and in the list add there is text Congratulations and Try Again

List list = new List(2, false);
list.add("Congratulations");
list.add("Try Again");

In the syntax below serves as the making option and the writer inputs 3 options in it is listed in syntax chooser.add (" Monkey "); and in the first choice the author input text in the form of Monkey and for the second option and when the same syntax as command making the first choice.

fwc.add(list);
Choice chooser = new Choice();
chooser.add("Monkey");
chooser.add("Banana");
chooser.add("Albert");

In the syntax below explains making scrollbar is different with the case with the previous syntax that sntax this time just make a regular scrollbar tampa addition of text in it

fwc.add(chooser);
fwc.add(new Scrollbar());
fwc.setVisible(true);
}   
}
  • After doing the syntax write command above gradually then you need to compile the syntax in comand pront times and write the call in it in folder and local disk do you save file, like picture below:

88.jpg

  • Then the results will be in can like the picture below:

All syntax Below:

import java.awt.*;
public class FrameWControls extends Frame{
public FrameWControls(){
    
}
        public static void main(String args[]) 
        {
            FrameWControls fwc = new FrameWControls();
            fwc.setLayout(new FlowLayout()); 
            fwc.setSize(400, 850);
            fwc.add(new Button("Hi Utopian Friend"));
            fwc.add(new Label("Approved"));
            fwc.add(new TextField());
            
                CheckboxGroup cbg = new CheckboxGroup();
                fwc.add(new Checkbox("first", cbg, true));
                fwc.add(new Checkbox("second", cbg, false));
                fwc.add(new Checkbox("third", cbg, true));
                
                    List list = new List(2, false);
                    list.add("Congratulations");
                    list.add("Try Again");
                    
                        fwc.add(list);
                        Choice chooser = new Choice();
                        chooser.add("Monkey");
                        chooser.add("Banana");
                        chooser.add("Albert");
                        
                            fwc.add(chooser);
                            fwc.add(new Scrollbar());
                            fwc.setVisible(true);
        }   
}



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Absolutely, truly will be approved. Trust me dude @brainalien

I hope like that @ybreza wkwk
but I'm still waiting your approved wkwk

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hey @brainalien I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Suggestions

  • Contribute more often to get higher and higher rewards. I wish to see you often!
  • Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!

Get Noticed!

  • Did you know project owners can manually vote with their own voting power or by voting power delegated to their projects? Ask the project owner to review your contributions!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

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

Coin Marketplace

STEEM 0.17
TRX 0.15
JST 0.028
BTC 60638.91
ETH 2449.26
USDT 1.00
SBD 2.52