Learning java - assistance needed

Good morning everyone!
I've been beating my head against the table trying to figure out what I'm doing wrong here, and my wife pointed out that I should maybe..I dunno, ask for help?
Here's the situation:
I'm designing a cell phone keypad with a text field above and a separate clear button to the right of the 12 button keypad. Buttons 1-0, and * and #.
Heres the first of two problems:
My GridLayout is propagating as a FlowLayout I think, either that or it's just ignoring me altogether.
I need to know what mistake I'm making, but the three manuals I've been going through aren't helping me much.
Here's the second and final problem:
My button pressing escapades are having no impact on my textfield. This is definitely a case of can't see the forest for the trees. I know it's an obvious mistake, but I'm getting a bit frustrated so I'm missing it.
And here's my code below, if there are optimizations possible, my pride will not be hurt if you suggest them.
Thank you for your time folks, and thanks for all the assistance you've unknowingly given me before.
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class KeyPadTwo extends JPanel
     JTextField numbers;
     JButton b1, b2, b3, b4, b5, b6, b7, b8, b9, b0, ba, bb, clear;
     JPanel textPanel, clearPanel, buttonPanel;
     public KeyPadTwo ()
          JPanel contentPane = new JPanel(new BorderLayout());
          JPanel textPanel = new JPanel();
          textPanel.setLayout(new BorderLayout());
          JTextField numbers = new JTextField(20);
          add(numbers);
          contentPane.add(textPanel, BorderLayout.NORTH);
          JPanel buttonPanel = new JPanel(new GridLayout(3,3));
          buttonPanel.setBackground (Color.darkGray);
          JButton b1 = new JButton("1");
          JButton b2 = new JButton("2");
          JButton b3 = new JButton("3");
          JButton b4 = new JButton("4");
          JButton b5 = new JButton("5");
          JButton b6 = new JButton("6");
          JButton b7 = new JButton("7");
          JButton b8 = new JButton("8");
          JButton b9 = new JButton("9");
          JButton b0 = new JButton("0");
          JButton ba = new JButton("*");
          JButton bb = new JButton("#");
          add(b1);
          add(b2);
          add(b3);
          add(b5);
          add(b6);
          add(b7);
          add(b8);
          add(b9);
          add(b0);
          add(ba);
          add(bb);
          ButtonListener digitListener = new ButtonListener();
          b1.addActionListener (digitListener);
          b2.addActionListener (digitListener);
          b3.addActionListener (digitListener);
          b5.addActionListener (digitListener);
          b6.addActionListener (digitListener);
          b7.addActionListener (digitListener);
          b8.addActionListener (digitListener);
          b9.addActionListener (digitListener);
          b0.addActionListener (digitListener);
          ba.addActionListener (digitListener);
          bb.addActionListener (digitListener);
          contentPane.add(buttonPanel, BorderLayout.CENTER);
          JPanel clearPanel = new JPanel(new GridLayout(0,1));          
          JButton clear = new JButton("C");
          add(clear);
          ClearListener clearListener = new ClearListener();
          clear.addActionListener(clearListener);
          contentPane.add(clearPanel, BorderLayout.EAST);
      private class ButtonListener implements ActionListener
          public void actionPerformed(ActionEvent e)
               Object source = e.getSource();
               String result;
               result = "";
               if(source == b1)
                    result = numbers + "1";
               else if (source == b2)
                    result = numbers + "2";
               else if (source == b3)
                    result = numbers + "3";
               else if (source == b4)
                    result = numbers + "4";
               else if (source == b5)
                    result = numbers + "5";
               else if (source == b6)
                    result = numbers + "6";
               else if (source == b7)
                    result = numbers + "7";
               else if (source == b8)
                    result = numbers + "8";
               else if (source == b9)
                    result = numbers + "9";
               else if (source == b0)
                    result = numbers + "0";
               else if (source == ba)
                    result = numbers + "#";
               else if (source == bb)
                    result = numbers + "*";
      private class ClearListener implements ActionListener
          public void actionPerformed(ActionEvent c)
               numbers.setText(" ");
     public static void main(String[] args) {
        JFrame frame = new JFrame("KeyPad Demo");
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      KeyPadTwo kp = new KeyPadTwo();
          frame.getContentPane().setLayout(new BorderLayout());
          frame.getContentPane().add(kp, BorderLayout.CENTER);
      frame.setSize(250, 200);
      frame.setVisible(true);
     

Onker wrote:
Am I adding the buttons incorrectly? I've never done nested panels for an assignment before, at least not with multiple layout types.The best way I've found to test complex layouts is to test each component in isolation. For instance if I wanted to test a gridlayout, I'd create a small app that creates nothing but this:
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class MainPanel extends JPanel
  private String[] btnStrings =
    "A", "B", "C", "D", "E", "F", "G", "H", "I", "*", "Z", "#"
  private JPanel buttonPanel = new JPanel();
  public MainPanel()
    buttonPanel.setLayout(new GridLayout(0, 3));
    ButtonListener buttonlistener = new ButtonListener();
    for (int i = 0; i < btnStrings.length; i++)
      JButton button = new JButton(btnStrings);
button.addActionListener(buttonlistener);
buttonPanel.add(button);
this.add(buttonPanel); // this is redundant here, but placed here to impress that buttonPanel must be added to the MainPanel to be seen
private class ButtonListener implements ActionListener
public void actionPerformed(ActionEvent e)
String btnString = e.getActionCommand();
System.out.println("Button pressed: " + btnString);
private static void createAndShowUI()
JFrame frame = new JFrame("ButtonPanel");
frame.getContentPane().add(new MainPanel());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
public static void main(String[] args)
java.awt.EventQueue.invokeLater(new Runnable()
public void run()
createAndShowUI();
And then when working, I'd incorporate it into the greater program.
Edited by: Encephalopathic on Jun 22, 2008 10:57 AM

Similar Messages

  • JAVA ASSISTANCE NEEDED IN DOING FIRST APPLET !

    Dear People,
    Every time I try to clean up the errors,
    I start a new project and the JBuilder gives each
    new project a new name of course but it also carries over
    the error messages from the previous project to the new
    applet so trying to clean up the error messages is a
    frustrating process.
    The improved coding is below and the remaining messages
    Thank you for your advice
    Stan
    package stan_event_makebox;
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import objectdraw.*; //imported library
    public class myApplet extends Applet {
    private boolean isStandalone = false;
    //Get a parameter value
    public String getParameter(String key, String def) {
    return isStandalone ? System.getProperty(key, def) :
    (getParameter(key) != null ? getParameter(key) : def);
    //Construct the applet
    public myApplet()
    // Here is the coding that I need to put into the applet template.
    // Change text color depending on whether mouse
    // is up or down
    public class MouseIndicator extends WindowController
    private Text up, down;
    public void begin()
    up = new Text("UP",200,220,canvas);
    down = new Text("DOWN",200,200,canvas);
    up.setColor(Color.red);
    down.setColor(Color.gray);
    public void onMousePress(Location point)
    down.setColor(Color.red);
    up.setColor(Color.gray);
    public void onMouseRelease(Location point)
    up.setColor(Color.red);
    down.setColor(Color.gray);
    //Initialize the applet
    public void init() {
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    //Component initialization
    private void jbInit() throws Exception {
    //Get Applet information
    public String getAppletInfo() {
    return "Applet Information";
    //Get parameter info
    public String[][] getParameterInfo() {
    return null;
    //Here are the error messages (its a mess)
    "Applet3.java": Error #: 204 : illegal start of expression at line 23, column 2
    "Applet3.java": Error #: 207 : not an expression statement at line 17, column 11
    "Applet3.java": Error #: 202 : 'class' or 'interface' expected at line 54, column 11
    "Applet2.java": Error #: 204 : illegal start of expression at line 25, column 2
    "Applet2.java": Error #: 207 : not an expression statement at line 16, column 10
    "Applet2.java": Error #: 204 : illegal start of expression at line 26, column 2
    "Applet2.java": Error #: 206 : malformed expression at line 25, column 2
    "Applet2.java": Error #: 204 : illegal start of expression at line 28, column 2
    "Applet2.java": Error #: 206 : malformed expression at line 26, column 2
    "Applet1.java": Error #: 204 : illegal start of expression at line 23, column 2
    "Applet1.java": Error #: 207 : not an expression statement at line 17, column 11
    "Applet1.java": Error #: 202 : 'class' or 'interface' expected at line 54, column 11
    "Applet1.java": Error #: 202 : 'class' or 'interface' expected at line 75, column 1
    "myApplet.java": Error #: 204 : illegal start of expression at line 21, column 1
    "myApplet.java": Error #: 207 : not an expression statement at line 16, column 10

    If you code it yourself, instead of using some massively complexifying IDE, you could probably do it in about 20-30 lines. Heck, I'll do it right here (but watch out for typos, I'm notorious for them):
    import java.awt.*;
    import java.awt.event.*;
    public class ColorChanger
    extends java.applet.Applet
        private Color upC = Color.red;
        private Color downC = Color.blue;
        private Label text = new Label("No input yet");
        private String upT = "UP";
        private String downT = "DOWN";
        public ColorChanger()
            add(text);
            text.setSize(text.getPreferredSize());
            text.addMouseListener(
                new MouseAdapter()
                    public void mousePressed(MouseEvent me)
                        text.setText(downT);
                        text.setForegroundColor(downC);
                    public void mouseReleased(MouseEvent me)
                        text.setText(upT);
                        text.setForegroundColor(upC);
    }The ony reason I did that for you is because I hate IDEs!
    -Tim
    P.S. No guarantees on whether or not it works. I didn't bother to look up the correct method names...

  • Need advice/suggestions on HOW and WHERE to START learning JAVA Prog.

    Hello
    MY educational background is Bachleor in Computer Science and Engg. (BE). I just landed in US and need to learn Basic JAVA programming , fundamentals, concepts of swing, JSP, JDBC connectivity............it might sound wierd seeing the above list but all i need to do at my work in future is all about DOCUMENTUM and i have very little time say 40 days to learn core java and its concepts coz that wuld come to play when i work on documentum.......even if come across something which i havent learnt in java, i guess i culd manage looking up some reference books, learn and do the job.....so can someone guide me thru the learning process of core java........i have been using " JAVA 2 Fundamentals Cay S Horstmann and Gary Cornell" and the basic tutorials which is available at sun.com but i am finding difficulty in remembering the concepts although i have understood it earlier. Is there a comprehensive online tutorial which can guide me through the learning process of core java?
    The resources available :
    P4 HP laptop
    24/7 High speed LAN
    the book i have mentioned earlier.
    just cant wait to start learning java
    Thanks

    Hello
    MY educational background is Bachleor in Computer
    Science and Engg. (BE). I just landed in US and need
    to learn Basic JAVA programming , fundamentals,
    concepts of swing, JSP, JDBC
    connectivity............it might sound wierd seeing
    the above list but all i need to do at my work in
    future is all about DOCUMENTUM and i have very
    little time say 40 days to learn core java and its
    concepts coz that wuld come to play when i work on
    documentum.......even if come across something which
    i havent learnt in java, i guess i culd manage
    looking up some reference books, learn and do the
    job.....so can someone guide me thru the learning
    process of core java........i have been using " JAVA
    2 Fundamentals Cay S Horstmann and Gary Cornell" and
    the basic tutorials which is available at sun.com but
    i am finding difficulty in remembering the concepts
    although i have understood it earlier. Is there a
    comprehensive online tutorial which can guide me
    through the learning process of core java?
    The resources available :
    P4 HP laptop
    24/7 High speed LAN
    the book i have mentioned earlier.
    just cant wait to start learning java
    ThanksOk, I haven't been much help here lately, but I'd like to help here if I can. In my opinion, you're talking about Advanced Java topics here. You are basically asking to run before you walk.
    Can you compile and run a simple 'Hello World' program in Java?
    I've always found that a positive way to start.

  • I need an opinion guys - Oracle guy learning Java Here.......

    Hi all,
    I was laid off about 6 weeks ago from the consulting firm I worked for for 7 years ....... I did Oracle
    Custom Development using PL/SQL and Oracle Forms/Reports on a Web Apps Server.... this I did for about 2 years. Prior to that I was a COBOL guy with about 20 years experience. I've heard
    that the way of the future in Oracle DB programming will be a transition from PL/SQL to JAVA so
    that's why I'm learning JAVA .
    I have started to teach myself JAVA during my un-employment and am having a great time (although trying to remember the nomenclature is "kindOfHard" ;-) )...
    Once I finish this self-study course (Deitel and Deitel JAVA 2 - How to Program... very good btw)
    I plan on taking the JCP test... I'm about 1/4 thru the book and have been writing 5 of the hardest programs that the book has as exercises at the end of each chapter.
    Has anyone out there ever experienced a transition such as this and is getting the JCP going
    to help me get a JAVA job with little-to-none JAVA programmin Business experience ?????
    I guess I'm a tad down today as I've never been unemployed and getting some opinions from
    the great folks out there sure makes the day go wonderfully.....
    Thanks for letting me ramble on,
    Mike
    Cleveland Ohio

    Hi Mike,
    have a look at :
    http://forum.java.sun.com/thread.jsp?forum=361&thread=234679
    that might give you some hints. I am not certified, did Oracle PL/SQL as well but also C++ so the transition to Java was (fairly) easy. Anyhow best of luck and keep going.
    Phil

  • Im Trying To Learn Java :o(

    Hey All,
    I have decided to get my mind active and randomly learn Java. I say randomly because i am going to be a student again in IT but i like the kinda 3D side and modelling and nice pictures and flash actionscript lol not all this stuff.
    Anways i would just start by saying that Java offends me massivly, i know something happened with M$ and Sun and ever since then all i have had with the sun download is problem after problem and crashing and all iw as tryin to do was play some Jippii games. This aint a recent problem, it always happens and i must have reformatted xp around 7 times. So i stay away from applets!!!
    Anyways in 2002 when i started learning Flash it was because i seen a site i liked and wanted to do that. The equivelent is kinda like me saying "OK GUYS I HAVE JAVA NOW HOW DO I MAKE DOOM" anyways 2 and a half years later im happy with what i can do and have used alot of different apps and learned alot from 3dsmax to aftereffects etc.
    Anyways my goal out of this whole Java thing is to make a game like one i used to play when i was younger on the Amiga 500. No where has this game and a modern one would be great to play. The graphics suck but the physics were really nice.
    So my questions are:
    1) Java. Ok im going to be honest, i know nothing about Java, i dont even know if it can do what i want and what i really dont want is to spend a while learning this to be stuck with no effects for my game, ie are small particle effects possible in Java? I know Java is pretty slow for a proper language compared to C/C++ but how slow? Can you shift a hundred particles around the screen and still add physics in the background?
    2) Java. The whole thing confuses me massivly. Im not a big posting person as i tend to prefer searching but i dont even know where to begin. I will bite the bullet and say i aint going to have alot of problems with the syntax of the language itself. It all looks kinda how i expect it, obviously i dont mean i aint gonna have problems and lot of them but it is not REALLY alien to me to look at a bit code. At the same time it is. I need to know alot of stuff, things that the 2 ebooks i have just ignored. For example, when i compile something, i thought that meant it compiled to the EXE but infact it turned my "heyworld.java" into a "heyworld.class" file. This just makes no sense to me atall because i HATE command line stuff, i see it as reinventing the wheel so im trying to follow through on first of all netbeans (an that went off almost instantly) and a free one that got my hey world to work (well, class). I need to know if a compiler dont make a exe then whats the class for and what exactly is a class file. You know just stuff like that? Does anyone know i kinda dictionary so to speak? baby talk i mean, so far all i seem to get is explainations with words i dont understand.
    3) How difficult is it to make a 2D game in Java? To make this plainer, i aint having an applet run somewhere, i want a nice downloadable exe. Of course i will need to start at the beginning but i mean to get a ship on the screen with keys to move it and a "cave" roof to crash into, is this going to take a long long long time to get to that stage? You see, as i said before unless after a few days i have a object on screen to work with, i just get too bored to continue. for example "the object of this is to make a red circle move across the screen" REALLY interests me where as "today we are going to make a mock system for a small business user" sends me back to 3Dmax and the lighting i was reading about lol I tend to look at a piece of code and be devestated by its complexity then try and make it make sense over time. Is this possible with Java? It does work for me this, i was picking apart a isometric code in actionscript before i knew what a tween was.
    4) Theres so many different J*** J"EE things floating around that i dont actually know what one i am meant to use? I got 1.4.2 i think but thats all i know. Id like any other things that helped yourselfs start off in Java?
    Sorry to go into a bit detail here, its just that with this degree im starting, it soon branches off into 2 groups. Programmers and Designers. I feel i know the design side well enough to make a comparison but it would be rude to leave this side of the things out and write it off without atleast giving it a shot.
    Thank you very much for your time :o)
    Kind regards,
    Clarky.

    If you want an idea of what's possible with Java, do a google search for "java games" or something like that. I've seen occasional postings of what are supposed to be pretty cool games that have been written in Java, but I'm not into games, so I've never bothered to check 'em out personally.
    As to whether you can do it, well, you'll have to figure that out. Learning Java well enough to create a video game is not a trivial task. I don't just mean the syntax of the language, I mean the many APIs you'll be using, concepts like multithreading and exception handling, good OO principles, etc. Without a good handle on that stuff, your code will quickly turn into a morass that will be difficult to enhance, maintain, or debug.
    I suspect that the code to make a particular graphical event occur will be more verbose and complex in Java than in ActionScript, given that Java is a general purpose language and AS is more geared to GUIs. Nonetheless, I'm sure there are APIs out there (some free, some not) that will provide some higher level constructs than the core APIs to make some of that easier. You'll still be operating in the idiom of a general programming language though.
    There may also be a hybrid solution available--where you use Java to express the game logic and another language to express the graphics. I don't know anything about this kind of stuff though, so that's just speculation.
    You may get more precise advice in the GUI Building forums on http://forum.java.sun.com/ than here.
    Here are some resources to get you started on Java in general.
    Sun's basic Java tutorial
    Sun's New To Java Center. Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    http://javaalmanac.com. A couple dozen code examples that supplement The Java Developers Almanac.
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's Thinking in Java (Available online.)
    Joshua Bloch's Effective Java
    Bert Bates and Kathy Sierra's Head First Java.

  • For all the newbies who wants to learn Java

    I was a newbie like 4 months ago. i have some skills of OOP in C++ like 2 years back but since then i did'nt took any of programming language courses. I have experience in MSaccess and MYsql. i did my internship Last summer with Tennessee Education Lottery as a Database Analyst. At that time i realized what a Corporate Enviorment looks like. Trust me it was a formal interview and i passed it and they placed me in the IT department to write some scripts for the GUI terminal and at the same time create a Company Security Database. i did completed my project but i had to Learn Mysql. and then i realized Java was getting very popular. alot of people told me in the forums to go Java tutorial but i will not agree to start from the sun tutorial. you can do it only if you have a good or may be medium experience of OOP. it was really tough for me and then this magic guy came on the forum and told me to go on this website if you want to learn Java.
    http://chortle.ccsu.edu/java5/cs151java.html
    This site is a brilliant site specially the exercise problems and the quizes really attracted me to Java alot and now i came to realize how easy it is to program in Java rather than C++. Java forums have helped me alot in solving those exercise problems (not with the code but with a good explanation) which was very helpful for me. out of my 210 post i guess i have helped 30 people out and the rest of the questions are regarding those exercises. i came to know encapsulation, inheritance and all that stuff. though i am still not very perfect like i am still having trouble with ComparTo thing but it takes more practice. the more you practice the more you learn. so all the newbies if you really want to learn java even if you dont have any experience in OOp this is the site where you need to start. Hope this will definitely help you alot. thanks to all the Senior members navycoder, captain, paulcw, duffy, turingpest and others also who have helped me in the past. without you i would have not achieved the goal of learning java. now my next step is going to be learn GUI programming Swing. looks fun to me. but at the same time i have my final project for this semester to make on ONline Testing program which will have a database, php scripting and html and xml.
    I will post if i have any problems

    I was a newbie like 4 months ago. i have some skills
    of OOP in C++ like 2 years back but since then i
    did'nt took any of programming language courses. I
    have experience in MSaccess and MYsql. i did my
    internship Last summer with Tennessee Education
    Lottery as a Database Analyst. At that time i
    realized what a Corporate Enviorment looks like.
    Trust me it was a formal interview and i passed it
    and they placed me in the IT department to write some
    scripts for the GUI terminal and at the same time
    create a Company Security Database.Wow they really must like to gamble if they put you in charge of a security database - no offense meant, but that isn't the sort of thing you would want a brand new person working on, unless of course they were giving really high odds ;-)

  • Learning Java proxies - landscape question

    Hi guys,
    I could use a little help to learn Java Proxies, I'm just starting to get familiar with Java, I'm coming from the ABAP side.
    First and foremost what do I need from the system point view?
    We have an XI box and using file/FTP/IDoc adapters and also ABAP Proxies, I wrote some Java (mapping)functions, I am familiar with these.
    But for a Java proxy, I would need a separate Java server(?) to run the application on, is this correct?
    Can I use my own PC for this? (for learning purposes), I have NWDS installed on my PC.
    What are the steps to write a small simple Java Proxy.
    I would very much appreciate some help, guys, how do I start?
    Thanks a lot,
    Viktor

    Hi Viktor,
    You can work from your own machine. Becuase in Java Proxy scenarios, you are deploying EAR files in the XI server, and thru XI , you are executing the method written in the Java Application.
    Just check these links-
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/a068cf2f-0401-0010-2aa9-f5ae4b2096f9
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f272165e-0401-0010-b4a1-e7eb8903501d
    /people/prasad.ulagappan2/blog/2005/06/27/asynchronous-inbound-java-proxy
    /people/rashmi.ramalingam2/blog/2005/06/25/an-illustration-of-java-server-proxy
    Demo ~
    https://www.sdn.sap.com/irj/sdn/docs?rid=/webcontent/uuid/110ff05d-0501-0010-a19d-958247c9f798#jdi [original link is broken]
    Hope this helps,
    Regards,
    Moorthy

  • What's your strategy for learning Java technologies?

    Or, in other words, how do YOU acquire knowledge that is necessary for implementing Java technologies?
    After having spent one-and-a-half years developing an enterprise app, I've gained lots of knowledge about Java and some surface knowledge about its related technologies (JBoss, Hibernate, Ant, XDoclet, NetBeans and probably some others I can't think of at the moment).
    I'm now realizing that -- although the standalone prototype version of my program is growing mature -- I've still got lots to learn for refactoring it to a web platform. For example, I 've done small test projects using Servlets, but haven't done any work with JSP (or HTML for that matter) yet.
    Now, I'm sure I can learn JSP etc., but the questions I ask myself are: how long will it take?
    It's a rhetorical question of course (I don't expect an answer from you, the reader) However, it's an important issue because the months or years I spend fumbling around learning these new technologies, are time I could otherwise spend on the business logic and functionality of my program.
    So, how do you guys acquire knowledge of technologies? Official training perhaps? Or do you simply experiment until it works? Or do you rely on your company's knowledge base (e.g. someone in your company knows how it works)? Or do you get prototypes built from someone who already knows how it works?
    I�m really curious about this and would appreciate your thoughts.
    Thanks in advance,
    P

    Well, it seems like most of you simply read the
    various texts and try the vendors' examples. I'm
    surprised that no one mentioned ever having bought a
    prototype application from the onset. "bought"? What's that mean? You don't buy prototypes. You download evaluation versions, maybe.
    I try to find sample code and tweak it to see the effects. Otherwise, I start writing small sample code an build on that.
    I consider myself a reasonably competent core Java
    programmer, but I had serious difficulty configuring
    and merging its related technologies. There were so
    many disjointed pieces of instructional information
    that the additional research time really hurt our
    budget severely. Not an uncommon thing, I'm sure. There's a lot of stuff. But don't bother learning all of it. Not in detail, at least. It's a good idea to familiarize yourself with the names of packages/libraries and what they do. But only really learn what you need to learn for what you need to do. The next project you will probably need other things, so you learn them then.
    bsampieri,
    I've setup Tomcat and tried the examples--in fact, I
    normally follow tutorials for all products I hope to
    use. Problem is, the examples and tutorials never
    address my specific needs. So, I usually inch toward
    my goal by spending weeks or months in forums to
    continue where the tutorials leave off. Anything complex is going to not be there.... the trick is to identify pieces that you can pull out to build more complex apps. And the fact that JSP/servlets have the issue of being compounded by all the HTML/CSS/JS and HTTP protocol ... I don't want to say limitiations, exactly... Well, it just makes things more complex and harder to know what you need.
    Perhaps you guys are much faster and smarter than
    I...or you have a much bigger budget :)Probably not... on either account.

  • I want to start learning Java

    I want to learn Java, and write Java codes. I searched through this website for an article which explains what a develepment environment I must have, but couldn't find anything, because it is designed in a too formal manner.
    Can you simply give me a list of software to install to setup myself a Java development system?

    hkBattousai wrote:
    You kept giving me links from this website. I said it is very fomal and %95 of the information is trivia.
    Anyway I found the answer on a third party program's website:
    http://www.jcreator.com/installation.htm
    All I need is
    1) JDK
    2) A Java IDE
    Is this right?Of course, JCreator is a nice IDE for beginners. Also, it is simple to use.

  • Why learn Java if you know ColdFusion?

    ColdFusion is awesome for my work. I can make anything I want with it and seeing as 99% of my work is making web applications, I haven't needed to look elsewhere.
    I was just wondering why anyone would need to learn Java, if you already know ColdFusion... I understand that ColdFusion runs on Java, but is there anything special I could do with Java that is not possible in ColdFusion for use in websites?
    It intrigues me because I have to cover the work of an ASP.NET developer, and when I was looking at his C# code (which looked very similar to Java) it made me cry to think people make websites in this way. Compared to ColdFusion it looks archaic but then I remember that CF works with Java so I thought about looking into learning Java. But is there any advantage to me doing this?

    Correct, but it does depend on the app. I have written some high volume apps in CF only and not had an issue. But my primary work is with developing and maintaining a payment gateway and due to the nature of the application there are a few non-native CF components (both Java and Delphi). The beauty of CF is it's ability to seamlessly mix if you have to. But again, I prefer to keep non-CF dependancies to a minimum.

  • Recommendations for Book on Learning Java on Mac OS X Tiger?

    Can anyone recommend a book title or two on Learning Java on Mac OS X Tiger? A generic learn-java-book is fine -- it just has to not be Windows-only. ie. the examples or included CD should at least include instructions for running the examples on a JAVA IDE available for other platforms such as Mac OS X (e.g. Eclipse).
    Thanks in advance,
    ...ben
    PS. Wish Dave Mark had a Java version of his classic: Learn C on the Macintosh
    PB G4 15 1.67 GHz, iBook SE 0.47 GHz Mac OS X (10.4.3)
    PB G4 15 1.67 GHz, iBook SE 0.47 GHz   Mac OS X (10.4.3)  

    Just download eclipse and do sun's java tutorials. They're very well written and cover pretty much anything you need to do with Java.
    http://java.sun.com/learning/tutorial/index.html
    cheers,
    /john patton/

  • Why learn Java Instead of C++ or...

    Why should people learn Java and use Java than C++ or other programming languages?
    Some of my personal reasons are:
    1. Java supports four look and feels without having to create them from scratch, they are already available for quick use.
    2. Java compiles fast, and runs fast. It's easy to understand. You can *.jar it into one file! No *.dll's!!!

    I like Java too (duh!), but...
    Why should people learn Java and use Java than C++ or
    other programming languages?
    Some of my personal reasons are:
    1. Java supports four look and feels without having
    to create them from scratch, they are already
    available for quick use.
    What? how is that an advantage over much of anything? OK, you could say that you can write a very complex GUI application and have it run on a number of very different applications using a common L&F or a platform-appropriate L&F.
    2. Java compiles fast, and runs fast. It's easy to
    understand. You can *.jar it into one file! No
    *.dll's!!!Before there were .DLL's and .so's there were big-ass executable files with everything linked into them. Oh wait, you can still do that on Win32 and Unix if you want to (except of course for the OS shared libraries which Java's JRE needs too).
    Chuck

  • Learning Java in order?

    Is there a specific order to learning java. What I mean is, I hava already gone through the fundementals of java at the Java fundementals tutorial on the java.sun.com tutorials page. Now that I have gone through that what is next? JDBC? Servlets? JSP? I hardly ever use swing, or applets, but I need to also study enough of everything so that I can take the java certification exam later. But, I still dont know if there is a learning order to java. Do I need to learn servlets before JSP, or vise versa. Do I need to know JDBC stuff before I learn Servlets or JSP? The java tutorials page is not in any order except in the date that the tutorial came out. They still have tutorial that go back to 1997, and I am sure some things have changed since. They also have specialized areas, such as Collections, JavaBeans, RMI, etc... I am confused on this. Could someone give me a clue.
    orozcom

    Duffy,
    Thanks for the response. I looked at the tutorial
    again, and their is another java trail, "Essential
    Java Classes", which covers: exception handling,
    threads, io reading and writing, setting program
    attributes, and accessing system resources. I think I
    will go over that information first. Then, I may go
    into the specialized trials that have collections and
    what not. after that, I think I will go into the J2EE
    stuff, doing Servlets, and JSP's unless I need to
    learn that stuff before hand. Tell me what you think.I think that's wise.
    Here is the site:
    http://java.sun.com/docs/books/tutorial/index.html.
    Do you think I need to go over the basics of Swing,
    Applets, GUI's, and in the order they specify?Personally, I don't use applets at all, but I know some folks here do. On those occasions when I have a UI, it's usually Web-based, so JSP and HTML are more important to me. I have done Swing, but not in a long time. Swing is worth knowing, and all learning is good, but the decision about where to spend your time is up to you.
    All I'm saying is make sure you have J2SE firmly in hand before you venture into J2EE, because J2EE builds on J2SE.

  • Learning Java but have problem displaying dialog

    I am learning Java by building a Platform based application. I have build the basic structure with several menu items and successfuly build two set of modules (an XML file reader and a set of initilization rouitnes. I amnow branching into a module to execute when a menu item is selected. I want to display a new window/dialog that contains a table showing the user options. However, I never get anythng displayed. The following code is from the menuitem handler. I commented out the logic I want to start working with, in an attempt to get something displayed. No Luck. I really need some help.
    public final class EditPreferences implements ActionListener {
         @Override
         public void actionPerformed(ActionEvent e) {
              JFrame frame = new JFrame("User and Project Preferences");
              JPanel panel = new JPanel();
    //          JTable table = new JTable( new PrefTableModel() );
    //          table.setRowSelectionAllowed(false);
    //          JScrollPane pane = new JScrollPane(table);
    //          table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    //          panel.add(pane);
              frame.add(panel);
              frame.setVisible(true);
    }I have been looking and reading all over the web and cannot figure this out. I think it should work, but is does not.

    If "frame" is a JFrame, as it is in your code, then (as of Java 5) frame.add(panel) is the same as frame.getContentPane().add(panel) . See Javadoc for JFrame.add . So, that's not your problem here.
    Try calling:
    frame.pack();before you call frame.setVisible. And, of course, uncomment the lines. Right now, your JFrame will still look empty, because your JPanel is empty.
    If you just want to see if a JFrame will display, you could replace the commented lines with something very simple:
    // Default layout of content pane is BorderLayout, default location is BorderLayout.CENTER
    panel.add(new JLabel("This is just a test."));

  • Sorting Assistance Needed

    Hello.
    I am learning Java and I am trying to create a simple app that sorts.
    I have a textfile with the following data: (lastname, firstname, age); eg:
    Purcell Scott 28
    Storms Doug 27
    Roedl Terry 40
    Fred Flintstone 35
    The textfile is separated with a space. I would like to read the text file (I know how to do that), then use the StringTokenizer to separate them, and then I want to sort the list by lastname, then firstname. I do want to allow duplicates.
    I have the following starter code below, but I am not sure what to do from there. I currently put the data into a Vector, in which I figure I could rip through the Vector and have the StringTokenizer pull out the last name, then sort that, but then I am lost on a technique to get the firstname and send that in if the lastnames are equal.
    I could also put them into an multi-dimensional array? Since I am new to Java, I do not know which way to turn.
    Is there anyone out there that may be able to assist me, or give me some guidelines, or pointers or snippets to get me rolling. I would really appreciate any assistance with this mission.
    Sincerely
    Scott K Purcell

    I kind of understand what you are telling me to do, but I could use a couple more lines of clarity.
    I know how to create the people class, but how do the two interact? Could you show me that?
    Thanks,

Maybe you are looking for

  • Can't open Raw files in Photoshop CS6 using Nikon D7100?

    I have a Nikon D7100 and recently did a photoshoot where I shot in Raw. Upon uploading my images and then attempting to open them in Photoshop it came up with a pop up saying that photoshop is unable to open that camera raw file. I have downloaded th

  • Problem in block based Query

    Respected Guru's I have a problem eith block bassed query.i have already used this block based query and it is working too. But here i am facing the the problem.why becuz i have used a global variable to pass value for execute it. and used 'set_block

  • Tons of Script Errors and Slow Redraw

    I recently setup CS 5.5 with Bridge 4.1.0.54 on a new MacBook Pro. When I launch Bridge I get the following messages: I'm confident of a few things. First, it's obviously somewhat related to this issue: http://forums.adobe.com/message/3083307 Second,

  • Why is the PAR file located in portalapps, pcd and temp folders???

    Hi all - I downloaded the com.sap.portal.runtime.logon.par.bak file to make changes to the logon page.  I renamed the PAR file after it was downloaded, made my changes, and exported back into the portal.  Everything is fine....I just have a question

  • Oracle 10.2.0.4 Instant Client for Mac OS X (Intel x86) is available

    The 10.2.0.4 Instant Client for Mac OS X (Intel x86) can be downloaded from: http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/intel_macsoft.html