1 Answer - Sort by: Date | Rating
HI
to run Frame (window) in java, you need to develop an awt or swing application.
There are certain steps you need to follow. Sequence of steps
1. Import statements
2. You need to exent the JFrame class, you can also implement actionlistener or any other event listener you want to use in your class
a typical delcaration would be
public class MyWindow extends JFrame implements ActionListener
{
//declare components as instance member
//constructor to initialize components
public MyWindow()
{
//set frame attributes
//other components
}
//event handler
public void actionPerformed(ActionEvent evt)
{
//handle actions here
}
//main method
public static void main(String [] args)
{
new MyWindow();
}
}
This is basic template for a Frame Application in Java.
Regards
Farah Khan
to run Frame (window) in java, you need to develop an awt or swing application.
There are certain steps you need to follow. Sequence of steps
1. Import statements
2. You need to exent the JFrame class, you can also implement actionlistener or any other event listener you want to use in your class
a typical delcaration would be
public class MyWindow extends JFrame implements ActionListener
{
//declare components as instance member
//constructor to initialize components
public MyWindow()
{
//set frame attributes
//other components
}
//event handler
public void actionPerformed(ActionEvent evt)
{
//handle actions here
}
//main method
public static void main(String [] args)
{
new MyWindow();
}
}
This is basic template for a Frame Application in Java.
Regards
Farah Khan
0
0
- What Is An Attribute In Java?
- Why Do We Use Public Static Void Main In Java?
- Do I Have To Write A Main Method In Every Class I Create?Why?
- Do I Have To Write A Main Method In Every Class I Create?
- What How The Step For Make Library Management?
- In Which Process We Can Start Java?
- Define The Concept Of Java Byte Code?
- How To Run Remote Method Invocation In More Machine?
- How To Run Java Remote Method Invocation In More Machine?
- How To Make A Java Program That Will Ask The User To Input A Number And Display All The Even Number And The Sum Of All Even Numbers Based On The Inputted/ Given Numbers?
- Is A Static Variable An Instance?
- How To Compile And Run Java Package?
- What Does Literati-on Mean?
- What Is Abstract Class In Details?
- What Is Meant By Remote Method Invocation In Java?
- What Is Meant By Package In Java?
- What Is Meant By Servlet In Java?
- When Was Java Released?
- What Is Latest Technologies In Java?
- Write A Program Using Do…..while Loop To Calculate And Print The First M Fibonacci Numbers?
- What Is The Difference Between Reference &instance Variable?
- Why Java Is Slow?
- What Is The Drawback Of Ms Access?
- What Is Replaced In Place Of Pointers In Java?
- What Replaces Pointers In Java?
- Who We Run Java Program When Extends Frame?
- How We Can Run The Program Of C++ In Java....?
- How To Compile And Run The Java Program?
- How Do You Run A RMI Program In Java Application?
- How Can I Run A C,C++ & JAVA Program From The Command Prompt?
- Can A Java Program Run Without A Main Method?
- How Can We Run Java Program By Using Command Prompt?
- Can A Java Program Can Run Without Main Program? If Not Solve Me This Problem?
- How Can I Write A Program In Java And Make It Run Like A .exe?
- How Can We Run Java Program By Command Prompt? Give Answer In Steps Please?

New Comment - Comments are editable for 5 min.