|
Hi Everyone,
I am working on applet automation. I am running applet in Internet Explorer and I an using java language for automation. How I get the applet control which run in browser using java or c#. I want to write a listener for Internet Explorer but I don't know how I write that. So please help me for applet automation in any language.
Thanks for help in advance.
|
|
|
|
|
|
Thanks for replying...
I want get the applet control ID and name which we can use for automation. I want automate applet as automating filling the value in text field and performing click event. I already done for java swing using java agent but I didn't find any solution for applet. Please give me a suitable direction. When I run the applet in applet viewer I can automate that one using the java agent. Problem is, if I run in browser then that is not AWT windows and I can not automate. How I get IE control using java language. How I write listener for IE window.
I want applet automation which run in browser using any language, but I am trying using java language.
thanks in advance...
|
|
|
|
|
I have a problem with constructors ... I never understood how they work.
At Caine c=new Caine();
Animal c1=new Caine();
Pisica p=new Pisica();
Error: Constructor Caine in Caine class cannot be applied to given class
package test2;
public class Test2 {
public static void main(String[] args) {
ListaAnimale lista= new ListaAnimale();
Caine c=new Caine();
Animal c1=new Caine();
Pisica p=new Pisica();
lista.adauga(c);
lista.adauga(p);
c.faceZgomot();
}
}
class ListaAnimale{
private Animal [] animale = new Animal[5];
private int index=0;
public void adauga(Animal a){
if(index <animale.length)
{
animale[index]=a;
System.out.println("Un nou animal pe pozitia " +index);
index++;
}
}
}
abstract class Animal{
private String nume;
private int varsta;
public Animal(String n, int a){
this.nume=n;
this.varsta=a;
}
public void faceZgomot(){System.out.println("ce zgomot face");}
public abstract void mananca();
public void doarme(){
System.out.println("Doaermee");
}
}
class Caine extends Animal{
public Caine(String n, int a){
super(n,a);
}
public void faceZgomot(){System.out.println("wooar");}
public void mananca(){System.out.println("caarne");}
}
class Pisica extends Animal{
public Pisica(String n, int a){
super(n,a);
}
public void faceZgomot(){System.out.println("miau");}
public void mananca(){System.out.println("lapte");}
}
|
|
|
|
|
Caine c=new Caine();
Animal c1=new Caine();
Pisica p=new Pisica();
Your constructors are demanding some values:
public Caine(String n, int a){
super(n,a);
}
so your main would initalize those as following:
Caine c=new Caine("String", 0);
Animal c1=new Caine("anotherString", 1);
Pisica p=new Pisica("oneMoreString", 2);
Constructors are not that complicated. it's just some OOP as in any other method that you write.
http://docs.oracle.com/javase/tutorial/java/javaOO/constructors.html[^]
regards Torsten
I never finish anyth...
|
|
|
|
|
At Caine c=new Caine();
Animal c1=new Caine();
Pisica p=new Pisica();
These 3 statements wont work. As you can see, your program does not have no-arg constructor. when you dont write any constructor, then compiler will include a default no-arg constructor.
If you are explicitly writing a constructor then default constructor wont be added. You have to write your own default no-arg constructor. Then the above lines will run successully.
Regards
Vipul
|
|
|
|
|
I am trying to get the font data(coordinate points) from some font file such as ttf, Is there a pre-defined mthod in java works same as pre-definedGetFontData function, where this function retrieves font metric data for a TrueType font
|
|
|
|
|
|
|
i have two executable file 1. s.exe and 2 p.exe. i want to create a single installer that will install all two exe in sequential. any body help please
|
|
|
|
|
What does this have to do with Java?
|
|
|
|
|
hai friends............
i want the source code to receive the string in java based mobile phone via bluetooth from computer............
pls help me friends.................
|
|
|
|
|
usic vicky wrote: i want the source code Then you need to write it yourself, or use Google to search for samples[^].
|
|
|
|
|
I want source code in java for room allocation and auto optimisation for rooms in any training institute according to number of students and room capacity and according to future requirement rooms are optimised itself
|
|
|
|
|
Member 10325645 wrote: I want source code in java for ...
Really? You've been here six months, and you haven't worked out that this site doesn't work like that?
If you need specific help with part of some code that you're working on, then we can help. If you just want someone to write some code for you, then you're in the wrong place.
It's even up there at the top of the page:
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'".
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
A homework question! Do your homework yourself. For specific problems, you may ask questions here, but it is up to you to learn to understand how things work, and hence you must try to write some simple programs instead of just copying code!
|
|
|
|
|
can anyone please help me with this.. ive created a class for gui..in which the frame consists 3 button and two text fields.. one button is to start server.. another button is to connect server.. and another button is for sending messages.. i have another server class... now how do i link the start server button object to server class inorder to start the server...???
startserver button say B1: gui class
link to server class?? can someone help me please..??
|
|
|
|
|
Write an event handler for the button, which creates a server object and starts it. Or is that too obvious?
|
|
|
|
|
You have need to implements ActionListener add actionlistener event like this
JButton btnStartServer = new JButton(" >> Start Server <<");
//Add action listener to button
btnStartServer.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
//Execute when button is pressed
Server svr=new Server()
svr.startServer();
}
});
In Server class you have to create a startServer() method to do backend processing part.
Like This Example Code:
public void startServer() {
keepGoing = true;
/* create socket server and wait for connection requests */
try
{
// the socket used by the server
ServerSocket serverSocket = new ServerSocket(port);
// infinite loop to wait for connections
while(keepGoing)
{
// format message saying we are waiting
display("Server waiting for Clients on port " + port + ".");
Socket socket = serverSocket.accept(); // accept connection
// if I was asked to stop
if(!keepGoing)
break;
ClientThread t = new ClientThread(socket); // make a thread of it
al.add(t); // save it in the ArrayList
t.start();
}
// I was asked to stop
try {
serverSocket.close();
for(int i = 0; i < al.size(); ++i) {
ClientThread tc = al.get(i);
try {
tc.sInput.close();
tc.sOutput.close();
tc.socket.close();
}
catch(IOException ioE) {
// not much I can do
}
}
}
catch(Exception e) {
display("Exception closing the server and clients: " + e);
}
}
// something went bad
catch (IOException e) {
String msg = sdf.format(new Date()) + " Exception on new ServerSocket: " + e + "\n";
display(msg);
}
}
/*
manoj kumar
|
|
|
|
|
hi guys please help any body
|
|
|
|
|
|
Hi , I am just trying to reverse all the words of a string at their place only ex if there is a string : "vandana is a good girl" then the out put of the program should be "anadnav is a doog lrig" for that i have created a package to calculate the no of words in the string and also for calculating reverse of a string that pacage is:
package p1;
public class meth
{
public int cal(String s)
{
int wrd=0;
for(int i=0;i<s.length();i++)
{
char c=s.charAt(i);
if(Character.isWhitespace(c))
{
wrd++;
}
}
return wrd+1;
}
public String rev(String b)
{
String p="";
for(int i=0;i<b.length();i++)
{
p=b.charAt(i)+p;
}
return p;
}
}
-----------------------------------------------------------------And the code of my program is :
import p1.*;
import java.io.*;
class rv
{
public static void main(String args[]) throws IOException
{
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
System.out.println("Enter your string :");
String s=br.readLine();
meth ob=new meth();
int n=ob.cal(s);
String m="";
while(n>=0)
{
for(int i=0;i<s.lenght();i++)
{
char c=s.charAt(i);
if(Character.isWhitespace(c))
{
String p=s.substring(0,i);
meth ob1=new meth();
String sb=ob1.rev(p);
m=m+" "+sb;
s=s.substring(i+1,s.length());
}
}
n--;
}
System.out.println(m);
}
}
but the problem is my program gives different different out put and it's not working well and i've tired to understand th problem.
-- modified 5-Apr-14 14:25pm.
|
|
|
|
|
Why make it so complicated? Just read the string and then loop through the characters in reverse order and print each one. You will end up with the string reversed.
|
|
|
|
|
i need to reverse the spelling of words and need not to change their order i.e dog is an animal out should be: god si na lamina .if i use for loop then then the whole string get it'sreverse.
|
|
|
|
|
Then all you need to do is split the string at each wordbreak (e.g. space) and then do the same to each word.
|
|
|
|