|
I would say : you shouldn't name the class as Date, since it can be confusing with the Date valuetype.
...
class DateTest {
...
}
|
|
|
|
|
thanx....
|
|
|
|
|
hello,m new in java.I m developin a login applet(client) which will send username and password to server,which will ultimately connect to database and authenticate the username and password.
how do i pass object b/w client and server???
i know the class have to implement serializable interface.
and i know the methods objectoutputstream and objectinputstream but i dont know how to actually implement them..
please help.
|
|
|
|
|
Kunalpuranik wrote: i know the class have to implement serializable interface.
This interface is for saving and restoring an object's state, it has nothing to do with client/server communication. You will need to use some socket implementation to achieve your objective.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
hey,i know the socket programming.but the socket programming is just to establish a link between client and the server.
i also know how to transfer strings between client and server as i have developed a chat application.
but what iam asking is how to transfer the object of my client class to my server end..
and the reason ive not written the code is because i dont know how to implement and thats why iam askin.
and if u want i can post my simple client server chat application code here.
|
|
|
|
|
Kunalpuranik wrote: socket programming is just to establish a link between client and the server.
Well it's a bit more than that.
Kunalpuranik wrote: how to transfer the object of my client class to my server end.
The same way that you would transfer anything, convert it to a byte stream and squirt it down the socket.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Richard MacCutchan wrote: This interface is for saving and restoring an object's state, it has nothing to do with client/server communication
Well, strictly speaking he's right. If you want to send an object through a socket, the object must be serializable. If it isn't serializable then you have to convert its state to a serializable form (e.g. by invoking defaultWriteObject from ObjectOutputStream) before you can send it through the socket.
Think about it: the very act of sending an object from the client to the server involves saving its state at one end of the communication, and restoring it at the other.
|
|
|
|
|
True, the shouting sent me veering off course. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Hey Guys,I am new bie to java3d.I want to know that am I on right message Board.Or this one is only for core java.
So,only after I can proceed with my questions.
Java3DArtist
|
|
|
|
|
You are on the right board, but I do not know whether you will find many answers here. Java3D is a subject that not many people seem to be familiar with. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
I amworking n importing a wsdl and displaying the methods in wsdl2.0 file in jave any ideas on this will be appreciated
|
|
|
|
|
Hi I'm tring to track my packages with my program..
I should fill a textbox called barkod with a value .. then click the button in the
website : PTT Genel Müdürlü?ü-General Directorate of Turkish Post
Trace Registered Postal Items
_____________________
|___BARCODE NUMBER___| BUTTON
but I couldn't do it, the code still returns the source codes of the main page..
what should I do ??? =((((
int ch;
URL url;
url = new URL("http://www.ptt.gov.tr");
String page;
HTMLDocument myDoc = null ;
myDoc=(HTMLDocument)url.openConnection();
HTMLInputElement barkod = (HTMLInputElement)myDoc.getElementsByName("barkod");
barkod.setValue("RJ464842336GB");
HTMLInputElement buton = (HTMLInputElement)myDoc.getElementsByName("Sb22");
buton.click();
|
|
|
|
|
Hey,
Anyone have an example of a J2ME 2d side scroller game code i can look at?
Thanks
|
|
|
|
|
hello guys.....have you been able to find a method which could clear the screen in java?? Can we try, putting in a loop, something like
gotoxy(i,j);
where i,j are rows and columns respectively and then printing a balnk??modified on Saturday, March 13, 2010 4:37 AM
|
|
|
|
|
Do you mean in a console or swing application? If it's swing then you have total control of what is drawn to the screen. In a console app there is no concept of a window. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
yes...i wanted it on a console....im trying hard to find this out but still, u know. I have read somewhere that we can use System.exec("cls"); but that too is not working.
|
|
|
|
|
I am not sure this is possible from Java. "cls" is an internal 'MSDOS' command so can only be run from an invocation of CMD.EXE. However I do not think that this will do what you want. Take a look at Runtime.getruntime().exec() for further information.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
hello Friends
I am using java3d Library.In regarding to that I am creating a scene with Multitexture.For that I am using Combine Mode,SetCombineRGBSource function.But I am not getting the full description of SetCombineRGBSource function,specially its parameter.
Is anyone aware of all these?
Thanks & Regards
Yogesh Sikri
|
|
|
|
|
Hey all,
I'm having trouble getting an applet to use the printer. Every time, it pops a message stating "The applet has requested access to the printer. Do you want to allow this action?" I check yes to an option underneath stating to always allow access, however, it seems that there is a lack of communication going on here, because the same message pops up next time. I've read that this can be fixed by adding this line to the java policy security file (java.policy):
permission java.lang.RuntimePermission "queuePrintJob";
But that solution doesn't work well for me, because I can't have everyone that uses my applet change their security files to avoid the annoying popup. The applet is signed, however, it's print method is being called directly from javascript and so I think there may be a bit of security tightening going on there causing the problem. Is there a checkbox or a setting somewhere I can have my users set, or is there something I can do on my end?
|
|
|
|
|
The problem here is that applets run in the browser, and browsers are not allowed access to system resources without the express permission of the PC user. Otherwise their systems could be compromised by webpages changing things without their knowledge. I don't think there is any way round this issue. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
True, which is why there is a security policy file, which prevents access as the default. However, you can get around it by adding that line to the file. I was wondering if there was an easier way to change it, rather than editing that policy file by hand.
|
|
|
|
|
Klazen wrote: I was wondering if there was an easier way to change it
Not that I am aware of; and remember it would still require every user of your applet to change their own system.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Hello Klazen,
by seeing your post i am sending this Qus.
if you dont mind can you provide the code for printing the file from applet.
Please help me.............
|
|
|
|
|
> The applet is signed, however, it's print method is being called directly from javascript and so I think there may be a bit of security tightening going on there causing the problem.
You are correct. Wrap the call in a doPriviliged() method and it should work (in a trusted applet) without further intervention.
Messing with policy files is not something I would recommend even for development purposes.
|
|
|
|
|
We tried this fix and it seems to be causing further problems. Our implementation is:
try {
final Doc doc = new SimpleDoc (docBytes, javax.print.DocFlavor.BYTE_ARRAY.AUTOSENSE, null);
AccessController.doPrivileged(new PrivilegedExceptionAction() {
public Object run() throws PrintException {
DocPrintJob printerJob = selectedPrinter.getPrintService().createPrintJob();;
PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
printerJob.print(doc, aset);
result.setStatus("SUCCESS");
return null;
}
});
}
catch (Exception e) {
e.printStackTrace();
result.setStatus("FAILED");
}
We're using the doPrivileged call with PrivilegedExceptionAction so that we can report the failure to the server to be reported. The problem is we are now seeing in the production logs that a small percentage of the print jobs fail with PrivilegedActionException, which we never saw before. We have not been able to reproduce this in our test environments, so in fact we don't really know whether the previous versions were failing or not - maybe we're just seeing the exceptions in the logs now, but they were always there.
|
|
|
|