Web Hosting Tomcat, Java, JSP, Servlets, J2EE, PHP, MySQL

Cheap web hosting provider

30
Oct

TextField inputField; TextArea outputArea; Button B1,B2; List L;

TextField inputField; TextArea outputArea; Button B1,B2; List L; Panel p1,p2; } Text Output In addition to all of this, let s write up a quick method that will allow us to output text to the server. This really isn t necessary at this point, but it is a good idea to have a method for this in case you ever need to send complicated messages. Don t worry too much about this code. It is only a simple output to a PrintStream. Eventually we ll replace it with something more interesting. We return true for success, false for failure. Here it is: public boolean output(String str) { try { ps.println(str); return true; } catch(Exception e) { return false; } } GUI Setup Now let s set up the GUI. Once this step is complete, you should be able to compile the applet and play with all the neat components! However, because their Events go unhandled, they will be totally useless. Let s write the init() method now: public void init() { /* first, assign a BorderLayout and add the two Panels */ setLayout( new BorderLayout() ); p1 = new Panel(); p2 = new Panel(); p1.setLayout( new FlowLayout() ); add(”South”, p1); add(”North”,p2); /* next create the Field used for input. For fun, make it 80 columns wide. Add it to the south Panel */ inputField = new TextField(80); p1.add( inputField ); /* create the output Area. Make it 10 rows by 60 columns. Add it to north Panel */

Hint: If you are looking for very good and affordable webspace to host and run your tomcat hosting application check Virtualwebstudio tomcat web hosting provider

Comments are closed.

Home | About Us | Compare Plans | Standard Hosting | Business Hosting | Java Tomcat Hosting | Support | FAQ | Order Now!

Powered by Omnicus java hosting services. All rights reserved.
Entries (RSS) and Comments (RSS).