The Artima Developer Community
Sponsored Link

Java Answers Forum
Hello every body i am a new member and want some tips

3 replies on 1 page. Most recent reply: Jun 17, 2002 5:16 AM by abhijeet

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
biswajit sarangi

Posts: 5
Nickname: sarangi
Registered: Jun, 2002

Hello every body i am a new member and want some tips Posted: Jun 17, 2002 1:23 AM
Reply to this message Reply
Advertisement
hello friends i am a student doing my internship.I want some tips or solution to my problem it is really urgent .If any one can help me i will be very happy.Well i am new to develop java programs but i studied it for last 6 months.
THE PROBLEM-
1.this program works fine for the given po number refered in the program.
2.but my requirment is that the user will give the po_ number in the textfield from the applet and that will add up with the fixed url and show the document from the server.
3.If any one can give the solution i will make me a lot more relaxed.
Thanking you in advance. biswajit sarangi
if possible at bsarangi@mail.com



import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.net.*;
import java.lang.*;

public class ShowService12 extends Applet {



import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.net.*;
import java.lang.*;

public class ShowService extends Applet {
String targetString = "http://xxx.xx.xx.xx:yyyy/invoke/tools/OrdersPosition?VBELN=00012354253";

URL targetURL;

//applet initialisation.
public void init() {
setBackground(Color.red);
setForeground(Color.blue);
try {
targetURL = new URL(targetString);
}
catch (Exception e){}
Button b = new Button("Click To See The Service");
add(b);
b.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
getAppletContext().showDocument(targetURL);
}
});
Label PO_NUMBERp = new Label("PO_NUMBER: ", Label.RIGHT);
PO_NUMBER = new TextField(12);
add(PO_NUMBERp);
add(PO_NUMBER);
PO_NUMBER.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {

repaint();

}

});


}

public void stop() {
System.out.println("Ok This Is Fine");
}
}


abhijeet

Posts: 21
Nickname: sony
Registered: May, 2002

Re: Hello every body i am a new member and want some tips Posted: Jun 17, 2002 2:44 AM
Reply to this message Reply
Hi Biswajit,

You can get the value of the textfield with the method "getText()". You can add to the existing String variable "targetString" as "targetString + PO_NUMBER.getText()". This will append the text field value to the String variable "targetString".

abhijeet.

biswajit sarangi

Posts: 5
Nickname: sarangi
Registered: Jun, 2002

Re: Hello every body i am a new member and want some tips Posted: Jun 17, 2002 5:00 AM
Reply to this message Reply
hello
May b i am not able to find the exact manner to write the program .if possible can you give a code for that.
thx in advance
sarangi

abhijeet

Posts: 21
Nickname: sony
Registered: May, 2002

Re: Hello every body i am a new member and want some tips Posted: Jun 17, 2002 5:16 AM
Reply to this message Reply
Hi Biswajit,

Under the button event, include the following code:

targetString = targetString + PO_NUMBER.getText();

Now, post the URL with this new targetString. Hope you got the point now.


abhijeet.

Flat View: This topic has 3 replies on 1 page
Topic: writing an Excel file through java Previous Topic   Next Topic Topic: do classes have properties

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use