Results 1 to 12 of 12
  1. #1
    moshe12007 is offline Member
    Join Date
    Aug 2009
    Posts
    6
    Rep Power
    0

    Default 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...

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Swing. Learn Swing.

  3. #3
    moshe12007 is offline Member
    Join Date
    Aug 2009
    Posts
    6
    Rep Power
    0

    Default

    ok you have tutorial ???

  4. #4
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

  5. #5
    moshe12007 is offline Member
    Join Date
    Aug 2009
    Posts
    6
    Rep Power
    0

    Default

    thanks man that very good
    but i use in eclipse and when i do that :

    btn.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {

    }
    the compiler give me eror.. the eror("The ActionListener cannot be resolved to a type");
    why???

  6. #6
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    Did you import java.awt.event.*; ?

  7. #7
    moshe12007 is offline Member
    Join Date
    Aug 2009
    Posts
    6
    Rep Power
    0

    Default

    i do this and its work :

    file : actionPerformed.java
    import 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

    }

    }
    and the file : hello123.java


    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());

    }

    }
    but i cant to do like this :
    btn.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {

    }

  8. #8
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    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) {
            
          }
        });
      }
    }

  9. #9
    moshe12007 is offline Member
    Join Date
    Aug 2009
    Posts
    6
    Rep Power
    0

    Default

    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..

  10. #10
    Join Date
    Aug 2009
    Posts
    21
    Rep Power
    0

    Default

    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

  11. #11
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by moshe12007 View Post
    i try this in the jdk and its work thank man about the help
    We're all glad to help you here.
    if you can give me your email that you help me when i need help i will very happy..
    How much are you willing to pay?

    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.

  12. #12
    moshe12007 is offline Member
    Join Date
    Aug 2009
    Posts
    6
    Rep Power
    0

    Default

    ok thanks man you very help me
    my project its to make program that i give password in my soft and its move the password to other program and connection it...
    its very hard now but i want to do that.....

Similar Threads

  1. Replies: 2
    Last Post: 04-03-2009, 04:37 AM
  2. Replies: 0
    Last Post: 03-24-2009, 03:23 PM
  3. Program where the user can choose the algorithm
    By le_albina@hotmail.com in forum New To Java
    Replies: 1
    Last Post: 03-18-2009, 04:45 AM
  4. Replies: 0
    Last Post: 08-27-2008, 09:43 AM
  5. Which class and variable to choose?
    By kian_hong2000 in forum New To Java
    Replies: 8
    Last Post: 08-27-2008, 07:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •