|
-
September 15th, 2011, 11:09 PM
#1
PrintEvent help
Once again I have come to a halt I am in the proccess of tracking down the answer, but if someone here could save me some time that would be splendid.
PrintEvent's (for the record I have already imported the PrintEvent class) syntax is like this..
Code:
new PrintEvent(method(args));
I have encased mine in the 'try' statment.
My only question is how do I tell java WHERE to PrintEvent(); also, what syntax do I use to do so.
Just in case you need it here's mine:
Code:
PrintEvent pe = null;
paraM = newObj(paraM);
try {
bw.write(paraM);
pe = new PrintEvent(newObj(paraM));
} catch (IOException ioe) {
}
Last edited by kolt007; September 15th, 2011 at 11:49 PM.
-
September 16th, 2011, 08:01 AM
#2
Re: PrintEvent help
What are you trying to create a PrintEvent object for?
Do you get errors? Please copy and paste here the full text of the error message.
Norm
-
September 16th, 2011, 08:35 AM
#3
Re: PrintEvent help
Where did you get the PrintEvent class from.
-
September 16th, 2011, 01:25 PM
#4
Re: PrintEvent help
Code:
public String newObj(String paraM) {
BufferedWriter bw = null;
try {
bw = new BufferedWriter(new FileWriter("Objects"+(paraM)));
bw.write(paraM);
objectS(paraM);
return paraM;
} catch (IOException ioe) {
}
return null;
}
public void NewObjects(String paraM) {
//global
BufferedWriter bw = null;
PrintEvent pe = null;
paraM = newObj(paraM);
try {
bw.write(paraM);
pe = new PrintEvent(newObj(paraM));
} catch (IOException ioe) {
}
makeGlobalObject(2536, 4717, 2213, -1, 10);
}
No error's just when I go though it it doesn't print the event anywhere.
-
September 16th, 2011, 01:27 PM
#5
Re: PrintEvent help
 Originally Posted by ProgramThis
Where did you get the PrintEvent class from.
From: http://download.oracle.com/javase/6/docs/api/index.html
-
September 16th, 2011, 01:34 PM
#6
Re: PrintEvent help
it doesn't print the event anywhere.
Where are you trying to print the contents of the PrintEvent object?
Add this statement at the end of the NewObjects method to print it:
System.out.println("pe=" + pe); // print contents of PrintEvent object
Norm
-
September 16th, 2011, 01:50 PM
#7
Re: PrintEvent help
Is there anyway Ican make system.out.println() or system.out.format() etc.. print in the NewObejcts() method?
-
September 16th, 2011, 01:55 PM
#8
Re: PrintEvent help
Yes, You can use/call the System.out.println() method in any method.
Norm
-
September 16th, 2011, 02:08 PM
#9
Re: PrintEvent help
Code:
call(system.out.println(paraM));
Say's 'package system does not exist
What is the syntax for call?
-
September 16th, 2011, 02:10 PM
#10
Re: PrintEvent help
Check your spelling. Java is case sensitive.
Norm
-
September 16th, 2011, 03:26 PM
#11
Re: PrintEvent help
Code:
public String newObj(String paraM) {
BufferedWriter bw = null;
try {
bw = new BufferedWriter(new FileWriter("Objects//"+(paraM)));
bw.write(paraM);
objectS(paraM);
return paraM;
System.out.println(paraM);
} catch (IOException ioe) {
}
return null;
}
public void NewObjects(String paraM) {
//global
BufferedWriter bw = null;
PrintEvent pe = null;
call(System.out.println(newObj(paraM)));
makeGlobalObject(2536, 4717, 2213, -1, 10);
}
Say's
Code:
client.java:5618: 'void' type not allowed here
call(System.out.println((paraM)));
^
1 error
Finished!
Press any key to continue . . .
I've tried
Code:
call(System.out.println(paraM));
aswell say's void not allowed? It's werid because, my newObj class isn't void??
-
September 16th, 2011, 03:27 PM
#12
Re: PrintEvent help
Try this:
System.out.println("paraM=" + paraM);
Norm
-
September 16th, 2011, 03:37 PM
#13
Re: PrintEvent help
Code:
call(System.out.println(paraM));
gets
Code:
client.java:5617: 'void' type not allowed here
call(System.out.println(paraM));
^
1 error
Finished!
Press any key to continue . . .
I tried
Code:
call(newObj(paraM));
and, got:
Code:
client.java:5617: cannot find symbol
symbol : method call(java.lang.String)
location: class client
call(newObj(paraM));
^
1 error
Finished!
Press any key to continue . . .
-
September 16th, 2011, 03:39 PM
#14
Re: PrintEvent help
Where is the call(String) method defined? The compiler can not find its definition in the client class.
Norm
-
September 16th, 2011, 03:43 PM
#15
Re: PrintEvent help
is it a class in API or is it an interface?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|