Results 1 to 12 of 12
Thread: what to choose???(awt or swing)
- 08-11-2009, 03:26 PM #1
Member
- Join Date
- Aug 2009
- Posts
- 6
- Rep Power
- 0
what to choose???(awt or swing)
hi im c\C++ programmer i programmning in my home for fun
i want to start to programmnig in java . but i have problem what to choose awt or swing i have book of JAVA 2 of "Deitel" but this book very old from 1999 and i dont know from where to learn and what to choose????
sorry about my english...
thanks...
-
Swing. Learn Swing.
- 08-12-2009, 10:33 AM #3
Member
- Join Date
- Aug 2009
- Posts
- 6
- Rep Power
- 0
ok you have tutorial ???
- 08-12-2009, 10:50 AM #4
- 08-12-2009, 02:58 PM #5
Member
- Join Date
- Aug 2009
- Posts
- 6
- Rep Power
- 0
thanks man that very good
but i use in eclipse and when i do that :
the compiler give me eror.. the eror("The ActionListener cannot be resolved to a type");btn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
}
why???
- 08-12-2009, 03:07 PM #6
Did you import java.awt.event.*; ?
- 08-12-2009, 09:52 PM #7
Member
- Join Date
- Aug 2009
- Posts
- 6
- Rep Power
- 0
i do this and its work :
file : actionPerformed.java
and the file : hello123.javaimport java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class actionPerformed implements ActionListener {
@Override
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub
}
}
but i cant to do like this :
import javax.swing.*;
import java.awt.event.*;
public class hello123
{
public static void main(String args[])
{
JFrame frame = new JFrame("Hello Moshe");
frame.setSize(400,400);
frame.setVisible(true);
frame.setResizable(false);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOS E);
frame.setLocationRelativeTo(null);
JButton btn = new JButton("Ok");
frame.add(btn);
btn.addActionListener(new actionPerformed());
}
}
btn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
}
-
Works OK for me.
Java Code:import javax.swing.*; import java.awt.event.*; public class hello123 { public static void main(String args[]) { JFrame frame = new JFrame("Hello Moshe"); frame.setSize(400, 400); frame.setVisible(true); frame.setResizable(false); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLocationRelativeTo(null); JButton btn = new JButton("Ok"); frame.add(btn); btn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { } }); } }
- 08-13-2009, 12:05 PM #9
Member
- Join Date
- Aug 2009
- Posts
- 6
- Rep Power
- 0
i try this in the jdk and its work thank man about the help
if you can give me your email that you help me when i need help i will very happy..
- 08-13-2009, 01:28 PM #10
Member
- Join Date
- Aug 2009
- Posts
- 21
- Rep Power
- 0
u can directly go for some console programmes
and go for swing or web applications
because if u learn web applications.hope swing will be easy:) javadeveloper
-
We're all glad to help you here.
How much are you willing to pay?if you can give me your email that you help me when i need help i will very happy..
But seriously, no, that's not how this system works. If you have a problem, please post it here and again we'll be glad to help.
- 08-14-2009, 11:10 AM #12
Member
- Join Date
- Aug 2009
- Posts
- 6
- Rep Power
- 0
Similar Threads
-
How can I let someone choose the name of a file for my program to read?
By falsealarm in forum New To JavaReplies: 2Last Post: 04-03-2009, 04:37 AM -
How does eclipse choose existing source when new project is created?
By batkins61 in forum EclipseReplies: 0Last Post: 03-24-2009, 03:23 PM -
Program where the user can choose the algorithm
By le_albina@hotmail.com in forum New To JavaReplies: 1Last Post: 03-18-2009, 04:45 AM -
Why to Use Eclipse IDE and Option for this IDE to choose with other's IDE?
By mgrprasad90 in forum EclipseReplies: 0Last Post: 08-27-2008, 09:43 AM -
Which class and variable to choose?
By kian_hong2000 in forum New To JavaReplies: 8Last Post: 08-27-2008, 07:06 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks