Home Tutorialhelp Comment Use Simipler One

 
 

Comment

Ahmad Rajput
Use Simipler One,
June 22, 2009 at 12:56 PM

We can use a Simipler One

import java.awt.*;
import java.applet.*;

public class MyButton extends Applet{
public void init()
{

Button btnNorth=new Button("North");
Button btn South=new Button("South");
Button btnEast=new Button("East");
Button btnWest=new Button("West");
Button btnCenter=new Button("Center");

BorderLayout bl= (new BorderLayout());
setLayout(bl);

add(btnNorth, BorderLayout.NORTH);
add(btnSouth, BorderLayout.SOUTH);
add(btnEast, BorderLayout.EAST);
add(btnWest, BorderLayout.WEST);
add(btnCenter, BorderLayout.CENTER);

}
}



Thanks
Ahmad
View All Comments | View Tutorial
Related Tutorial and Articles
Java Tips and Examples

BorderLayout
can add at most one component to each region of a BorderLayout... // layouts/borderLayout/BorderTest.java - Demo use of BorderLayout // Fred Swartz... Java NotesBorderLayout java.awt.BorderLayout divides a container (eg 

General

BorderLayout Example In java
BorderLayout Example In java     ... BorderLayout in java awt package. The Border Layout is arranging and resizing... for using  this program. This Java Application uses BorderLayout for setting 

Java Tips and Examples

Summary - GUI Layouts 1 - FlowLayout, BorderLayout, GridLayout
Java: Summary - GUI Layouts 1 - FlowLayout, BorderLayout, GridLayout This section discusses about following layouts: a) FlowLayout c) BorderLayout c) GridLayout The code example discussed will show you how to use these layouts 

Java Interview Questions

java BorderLayout
java BorderLayout   How are the elements of a BorderLayout organized 

General

Java AWT Package Example
Java AWT Package Example       In this section you will learn about the AWT package of the Java... Example In Java In this section, you will learn how to create BorderLayout 

General

java awt package tutorial
Java AWT Package In Java, Abstract Window Toolkit(AWT) is a platform... every platform's native GUI toolkit. One of the AWT's significance... is used by each AWT component to display itself on the screen. For example 

Java-Tutorials

Create a Container in Java awt
Create a Container in Java awt     ... application. All the controls used in your application are the container for one another...). BorderLayout : BorderLayout is the class of the java.awt.*; package which is used 

Java Beginners

why and where we use setter and getter methods in java, please give me one example program.....
why and where we use setter and getter methods in java, please give me one example program.....  why and where we use setter and getter methods in java, please give me one example program 

Swing AWT

Java Dialogs - Swing AWT
/springlayout.html http://www.roseindia.net/java/example/java/awt/borderlayout-example... visit the following links: http://www.roseindia.net/java/example/java/swing...Java Dialogs  a) I wish to design a frame whose layout mimics 

Swing AWT

java - Swing AWT
java  how to use JTray in java give the answer with demonstration or example please 

Swing AWT

awt - Swing AWT
market chart this code made using "AWT" . in this chart one textbox when user..., For solving the problem visit to : http://www.roseindia.net/java/example/java/awt/ Thanks 

Programming Tutorials

Java: Example - Simple Calculator
Java: Example - Simple Calculator Here is the source for the simple...(b); } } //--- One ActionListener to use... place. Altho this simple example doesn't show the full power of separating 

Java Beginners

Java Comparable Example
Java Comparable Example  I want to know the use of Comparable Interface. Please provide me one example   Comparable interface is used.... Here is an example that compares two ages using Comparable Interface. import 

Java Beginners

Java Map Example
Java Map Example  How we can use Map in java collection?   ...), "Two"); mp.put(new Integer(1), "One"); mp.put(new Integer(3... :1 Value :One Key :2 Value :Two Key :3 Value :Three Key :4 Value :Four 

Java Tips and Examples

Java AWT Package Example
 

General

Java: HandyPerson Example
Java: HandyPerson Example 1 2 3 4 5 6 7 8 9.... // Style compromises were made to get this on one page. // Author : Fred Swartz, 22... String unplugDrain(){ return "HP: Use plunger"; } @Override public String 

Java Beginners

why we use design patterns in java?Example?
why we use design patterns in java?Example?  Hi..... Why we use design patterns?,why they are needed in programming languages?,advantages?   hi friend, please go through the following links may this will be helpful 

Swing AWT

AWT code for popUpmenu - Swing AWT
for more information. http://www.roseindia.net/java/example/java/awt/pop...AWT code for popUpmenu  Respected Sir/Madam, I am writing a program in JAVA/AWT.My requirement is, a Form consists of a "TextBox" and a "Button 

Hibernate Tutorial Example

Hibernate Many-to-one Relationships
Relationships - Many to one relationships example using xml meta-data This current example demonstrates the use of Many  to one relationships. We will use... and between levels in a hierarchy. In this example multiple stories (Java 

Date Calendar

date and time in awt(java)
date and time in awt(java)  sir, do you have an example of date in awt java which can be view over a textfield.   Display time in JTextField import java.util.*; import javax.swing.*; import java.awt.event.*; public 

Swing AWT

Java - Swing AWT
Java    Hi friend,read for more information,http://www.roseindia.net/java/example/java/swing 

Java Beginners

awt
Java AWT Applet example  how to display data using JDBC in awt/applet 

Programming Tutorials

ajax example
AJAX  What is AJAX?how we will use it in java?what is the use... ajax get example jQuery ajax get example  Hi, How I can use jQuery...Ajax Example Here is the list of few Ajax examples at RoseIndia.net. Ajax 

Swing AWT

java - Swing AWT
information, http://www.roseindia.net/java/example/java/awt/ Thanks...java  i want a program that accepts string from user in textfield1 and prints same string in textfield2 in awt   hi, import java.awt. 

Java Interview Questions

Example for when to use ArrayList and when to use HashMap - Java Interview Questions
Example for when to use ArrayList and when to use HashMap  Hi Deepak u have replied this answer for when to use arraylist and hashmap " When your... example for this "once objects stored using arraylist ow to retrieve that using 

Swing AWT

Need Help with Java-SWING progrmming - Swing AWT
Need Help with Java-SWING progrmming  Hi sir, I am a beginner in java-swing programming. I want to know how we can use the print option...://www.roseindia.net/java/example/java/swing/Print.shtml Thanks 

Java-Tutorials

Event handling in Java AWT
Event handling in Java AWT     ... events in java awt. Here, this is done through the java.awt.*; package of java. Events are the integral part of the java platform. You can see the concepts 

Blog

Java Args example
Debug with jdb Debug with jdb By: By Tony Sintes How do you use this crazy thing? How do you use jdb (included in the JDK 1.2 package) effectively to debug Java programs? I've tried many times, but I am successful only in loading 

General

Java Set iterator with example
Java Set Interface keeps the data without duplicate value. Its one subtype Treeset always returns sorted data. But the subtype HashSet doesnot return sorted data. It uses iterator() method to traverse the data Example of Java 

Swing AWT

java swings - Swing AWT
. http://www.roseindia.net/java/example/java/swing/draw-simple-bar...java swings  I am doing a project for my company. I need a to show... write the code for bar charts using java swings.  Hi friend, I am 

Swing AWT

provide code - Swing AWT
); } } ------------------------------------- visit for more information. http://www.roseindia.net/java/example... GAME.....using swings,awt concepts   Hi friend, import java.awt....(){ Dimension boardSize = new Dimension(600, 600); // Use 

Swing AWT

java - Swing AWT
Java Implementing Swing with Servlet  How can i implement the swing with servlet in Java? Can anyone give an Example??   Implementing Swing with Servlet Example and source Code Servlet SwingToServlet 

Java Beginners

Graphical calculator using AWT - Java Beginners
... But i got some errors while compiling some of them i made clear but still one error...); clearButton.addActionListener(new ClearListener()); //--- One listener for all...(); content.setLayout(new BorderLayout(5, 5)); content.add(m_displayField 

Java Beginners

java string comparison example
java string comparison example  how to use equals method in String... strings are not same. Description:-Here is an example of comparing two strings using equals() method. In the above example, we have declared two string 

General

Java: Example - Words to array
Java: Example - Words to array This example shows how to convert words to an array. We will use StringTokenizer to achieve the this.   Some times is is required to words into an array, to solve this you can use 

Java Beginners

throws example program java
throws example program java  how to use throws exception in java?   The throws keyword is used to indicate that the method raises..." java.lang.ArithmeticException: / by zero Description:- Here is an example of throws clause. We 

Java Beginners

Java collection Stack example
Java collection Stack example  How to use Stack class in java... :- -1 Description:- The above example demonstrates you the Stack class in java.... Here is an example of Stack class. import java.util.Stack; public class 

General

Java: Example - ColorDisplay
Java: Example - ColorDisplay In this example code we will show you how to make ColorDisplay application using Swing framework. This example shows color set by RGB scrollbars. In the main method of the example code we are doing 

Java Beginners

Inheritance java Example
Inheritance java Example  How can we use inheritance in java program... for bread Description:- The above example demonstrates you the concept... class by a sub class. With the use of extends keyword, the subclasses will be able 

Swing AWT

java swing - Swing AWT
: http://www.roseindia.net/java/example/java/swing/ Thanks...java swing  how to add image in JPanel in Swing?  Hi Friend, Try the following code: import java.awt.*; import java.awt.image. 

Java Beginners

Java collection Queue Example
Java collection Queue Example  How can we use Queue in java... LinkedList(); queue.add("Java"); queue.add("DotNet...) { new MainDemo().queueExample(); } } Output:- remove: Java element 

Java Beginners

Java Queue Example
Java Queue Example  how to use queue in java ?   import...(); queue.add("Java"); queue.add("DotNet"); queue.offer("PHP...().queueExample(); } } Output:- remove: Java element: DotNet poll: DotNet peek 

Java Beginners

Synchronized with example - Java Beginners
Synchronized with example  Hi Friends, I am beginner in java. what i know about synchonized keyword is,If more that one 1 thread tries to access a particular resource we can lock the method using synchronized keyword. Then after 

General

Java: Example - ToUppercase
Java: Example - ToUppercase Level Introductory Structure... 10 11 12 13 14 15 // ToUpperCase.java Example: Converts text in one field to uppercase in another. // Fred Swartz, 1999...2004-04-11 import 

Swing AWT

java - Swing AWT
java  how can i add items to combobox at runtime from jdbc   Hi Friend, Please visit the following link: http://www.roseindia.net/java/example/java/swing/AddRemoveItemFromCombo.shtml Thanks  Hi Friend 

Swing AWT

Java - Swing AWT
. http://www.roseindia.net/java/example/java/swing...("Paint example frame") ; getContentPane().add(new JPaintPanel 

Java Beginners

Java ArrayList Example
Java ArrayList Example  How can we use array list in java program ?   import java.util.ArrayList; public class ArrayListExample... demonstrates you the use of ArrayList. An ArrayList is a data structure. It can 

Swing AWT

java-swings - Swing AWT
://www.roseindia.net/java/example/java/swing/ Thanks. Amardeep...java-swings  How to move JLabel using Mouse? Here the problem is i have a set of labels in a panel. I want to arrange them in a customized order 

Swing AWT

AWT-swings tutorial - Swing AWT
://www.roseindia.net/java/example/java/swing/ http://www.roseindia.net/java/example/java...AWT-swings tutorial  hello sir, i am learnings swings and applets.. i want some tutorials and some examples related to swings.. thank you sir 

Java Beginners

awt in java
awt in java  using awt in java gui programming how to false the maximization property of a frame 

Java Interview Questions

awt - Java Interview Questions
awt  what is the difference between awt and swings  Hi friend, These are basically the main differences between awt and swing. 1.swing components sits on the top of AWT components and do the wiork. 2.AWT 

Swing AWT

use of plugins - Swing AWT
use of plugins  hi dear i m making a project on java swing .i needed a plugins for search buttons........  https://swingexplorer.dev.java.net/tips.html Thanks 

Java Interview Questions

Java AWT
Java AWT  What interface is extended by AWT event listeners 

General

Java Array Iterator with Example
of the Iterator interface to manipulate more than one ArrayList Java Array Iterator with Example import java.util.*; public class arrayIterator... Java Array Iterator is an interface in the collection framework. Java 

Java Beginners

array example - Java Beginners
a question about how many dependents 10. Use a loop to get the names and add... i cannot solve this example 

Ajax Questions

java persistence example
java persistence example  java persistence example 

Swing AWT

query - Swing AWT
java swing awt thread query  Hi, I am just looking for a simple example of Java Swing 

Java-Tutorials

Java Thread getStackTrace Example
Java Thread getStackTrace Example This section explains use of getStackTrace() method  in java Thread. Thread getStackTrace() : It returns an array of StackTraceElement, and individual of them shows one stack frame. acts 

Programming Tutorials

Java: Example - Scribble
Java NotesExample - Scribble 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25...()); //--- Layout components this.setLayout(new BorderLayout()); this.add(b 

General

Clone method example in Java
Clone method example in Java       Clone method example in Java programming language Given example of java clone() method illustrates, how to use clone() method. The Cloneable 

Java Technology Tutorials

Java Example Codes and Tutorials
Java Tutorials - Java Example Codes and Tutorials Java is great programming....    Use of Java...; Java Get Example 

Java Interview Questions

Java AWT
Java AWT  What is meant by controls and what are different types of controls in AWT 

Blog

AWT basics
AWT documentation AWT example AWT manual AWT tutorial...AWT basics Are you looking for the AWT Basics to help you learn AWT quickly? Here we have provided you the links to our AWT tutorials. AWT stands 

Java-Tutorials

Java - Copying one file to another
Java - Copying one file to another       Introduction This example illustrates how to copy contents from one file to another file. This topic is related 

Java Beginners

Java Client Application example
Java Client Application example  Java Client Application example 

Swing AWT

awt list item* - Swing AWT
information. http://www.roseindia.net/java/example/java/awt/ Thanks...awt list item*  how do i make an item inside my listitem...); choice.add("Java "); choice.add("Jsp"); choice.add("Servlets 

Programming Tutorials

Java: JPanel - Example
Java: JPanel - Example // Demo Application of use of JPanel for drawing. -- Fred Swartz // Modified from applet version 2001-09-09, 2002-02-07 import java.awt.*; import java.awt.event.*; import javax.swing.*; import 

Applet Questions

AWT Tutorials
AWT Tutorials  How can i create multiple labels using AWT????   Java Applet Example multiple labels 1)AppletExample.java: import javax.swing.*; import java.applet.*; import java.awt.*; import 

General

Java Get Example
is method and how to use the get method in Java, this example is going... will learn how to use the method getGraphics().   Java example program... Java Get Example       

JDBC Questions

awt jdbc
awt jdbc  programm in java to accept the details of doctor (dno,dname,salary)user & insert it into the database(use prerparedstatement class&awt 

General

Java Get Example
is method and how to use the get method in Java, this example is going... will learn how to use the method getGraphics().   Java example program... Java Get Example       

Java Beginners

Awt programming with java
Awt programming with java  Write a java program, which provides a text area with horizontal and vertical scrollbar.Type some lines in the text area and use scrollbars to move the text within the text area.Read a word in a text 

Java Beginners

java-awt - Java Beginners
java-awt  how to include picture stored on my machine to a java frame... frnd.... "\" is a special character... i think u must use "\\" whereever u want... information, http://www.roseindia.net/java/ Thanks 

Java Tips and Examples

Array List Example in java
Array List Example in java       In this example we are going to show the use of java.util.ArrayList....;} } The output of program will be like this: C:\Java 

JRuby

"TreeSet" example in JRuby
tutorials we have learned about how to use Java classes in JRuby program now here is one more example that uses Java class TreeSet.  In this example we have... "TreeSet" example in JRuby   

Core Java

Example of HashSet class in java
Example of HashSet class in java. In this part of tutorial, we... unique. You can not store duplicate value. Java hashset example. How.... Example of Hashset iterator method in java. Example of Hashset size() method 

Core Java

Example of HashMap class in java
Example of HashMap class in java. The HashMap is a class in java collection framwork. It stores values in the form of key/value pair. It is not synchronized 

Java Tips and Examples

Link List Example in Java
Link List Example in Java       In this example, we are going to show the use of java.util.LinkedList.... In this example we are using six methods of LinkedList class. add(Object o): Appends 

Java Beginners

Java FTP Client Example
Java FTP Client Example  How to write Java FTP Client Example code? Thanks   Hi, Here is the example code of simple FTP client in Java which downloads image from server FTP Download file example. Thanks 

General

Java HashMap iterator and example
. So use the entrySet() method to get the data in Set object form. Set's all elements can be traversed by the Iterator. Example of Java HashMap... Java HashMap Iterator is an interface. It keeps the data in the key 

Core Java

Example of Hashset iterator method in java.
Example of Hashset iterator method in java. In this exmple of HashSet class,  you will see the use of iterator() method. It is used for traversing all element from HashSet. Code:  HashSetRemoveElement.java package 

Swing AWT

DrawingCircle - Swing AWT
: http://www.roseindia.net/java/example/java/swing/ Thanks... BorderLayout()); content.add(drawing, BorderLayout.CENTER 

General

Java Map iterator with example
use the entrySet() method to get the data in Set object form. Use the entrySet() method to get the data in Set object form. Java Map Iterator with Example... Java Map Iterator is an interface. It keeps the data in the key and value 

Java Beginners

java program example - Java Beginners
java program example  can we create java program without static and main?can u plzz explain with an example 

Swing AWT

Java Program - Swing AWT
Java Program  A Java Program to send message from one computer to another 

Swing AWT

Java Program - Swing AWT
Java Program  A java Program that send message from one computer to another and what are the requirements 

General

Java Collection iterator with example
. Example of Java Collection Iterator import java.util.ArrayList; import... The Java Collection Iterator is present at the highest level interface in the Collection framework. Iterator interface has methods for traversing 

Java Beginners

FTP Java example
FTP Java example  Where is the FTP Java example on your website? I am... examples of FTP at: FTP Programming in Java tutorials with example code. Thaks... functionality in my Java based application. My application is swing based and I have 

Swing AWT

SWINGS - Swing AWT
more information,Examples and Tutorials on Swing,AWT visit to : http://www.roseindia.net/java/example/java/awt/ http://www.roseindia.net/java/example/java 

Java Beginners

Java FTP Example
Java FTP Example  Is there any java ftp example and tutorials... and tutorials that teaches you how to user FTP in your Java project. Most commonly used FTP api in java is Apache FTP. Browse all the FTP tutorials at Java FTP 

Swing AWT

Java Swings problem - Swing AWT
Java Swings problem  Sir, I am facing a problem in JSplitPane. I want the divider in the splitpane to be customized. I have a splitpane... pane. For example, if the split pane is of dimension (0,0,100, 400), then divider 

Swing AWT

Design a Toll bar - Swing AWT
://www.roseindia.net/java/example/java/swing/CreateToolbar.shtml Thanks...Design a Toll bar  Hi,i am very new to Swings-awt..... Please any one send me the Logic to Create a Toolbar which is similar to --- winword 

Java Beginners

freemarker example - Java Beginners
an example for freemarker. i want to get the values from java and display those values in the page designed using freemarker(how to get the values from java). and please provide an example with code and directory structure. send me ASAP 

General

SortedMap (interface) example in java Collection Framework
SortedMap (interface) example in java Collection Framework       In this example I will show you how you can use SortedMap interface in your Java application 

Swing AWT

Use of Hyperlink in Swing - Swing AWT
is: Is it possible to use Hypelink in java Swing. Please Help. Regards...Use of Hyperlink in Swing  Hi, We are developing the UI using the Java Swing and I have to create Hyperlink in the JTable cell so that if the user 

Swing AWT

Java swings - Swing AWT
Java swings  i have the following class .In that class i has two...)); JPanel panel1=new JPanel(new BorderLayout()); JPanel panel2=new JPanel... panel1=new JPanel(new BorderLayout()); JPanel panel2=new JPanel 

Swing AWT

java swings - Swing AWT
java swings  hi everyone, can we make a chain of frames with JSplitpane and run a shell script in any one of those frames 

JSP Tutorials

Inheritance in java with example
Inheritance in java with example          Inheritance is one of the concept...;How to Use Inheritance in the jsp</title> </head> < 

Swing AWT

java programming - Swing AWT
java programming  Develop a simple paint like program that can draw basic graphical primitives in different dimensions and colors. use appropriate menus and buttons 

Applet Questions

JAVA AWT BASE PROJECT
JAVA AWT BASE PROJECT  suggest meaningful java AWT-base project 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.