|
|
Hi All,
I am trying to add an image to a JPanel, however i know this is difficult to do and it would be easier to add an image to a JLabel then add the JLabel to a JPanel, then add the JPanel to the contentPane. I have two questions. 1) Which is the easiest way to add an image to a JLabel and 2) do i need to use an explicit path? I.g "C:/documents and setings/ my Documents /...."; etc or is there a way i could just name the directory E.g "images/JLabelpictures/thePicture.png";
Kurt
|
|
|
|
|
Hello!
Qaestion 1 - the answer is shown best in this tutorial @ oracle.com[^]
Question 2 - is also answered by that tutorial, you can use the relative path and do not need to use the absolute path.
In fact you should use the relative path and add all the images you use to a folder "project/res/icon" in your project.
regards
Torsten
I never finish anyth...
|
|
|
|
|
|
Dear all,
I am new to Java so excuse my mistakes please.
I have to learn how JDI (Java debug Interface) works, how it debugs a debugee?
I have run some samples code provided by jdk, but i am stuck in how to connect/attach it to a process (debugee)?
I l be greatly thankful for your comments.
Thanks
Ehsan karim
|
|
|
|
|
See here[^].
I must get a clever new signature for 2011.
|
|
|
|
|
Thanks dear Richard, it was very helpful..
If you are familiar to this, can you please give me reference of a complete example, so that i could understand it well and use it.
Thanks indeed
|
|
|
|
|
Ehsank001 wrote: can you please give me reference of a complete example
I'm afraid I don't have any. Also part of your job as a developer is to do your own research into new technology.
I must get a clever new signature for 2011.
|
|
|
|
|
Do you just want to know what debugging is about? or do you want to "use" the JDI in a "different" way?
If it's just the first, I would recommend you to just write some code, set up some breakpoints and find out how the debugging is working.
regards
Torsten
I never finish anyth...
|
|
|
|
|
hi for all
(SORRY FOR MY BAD ENGLISH )
i have this error
SEVERE: error shutting down input on socket
java.net.SocketException: Socket is closed
what should i do ?
(note that the program is running but this error is printed)
|
|
|
|
|
You need to look at your code, or run it through the debugger, to find out why the socket was closed at the wrong time.
I must get a clever new signature for 2011.
|
|
|
|
|
this often happens when a socket is closed in a loop or the socket just exists in a loop. check you code on this behavior or post your code (using the codeblock tags!)
regards
Torsten
I never finish anyth...
|
|
|
|
|
Hi,
This problem usually occurs when the server socket was closed , if you are the one writing the server socket also , please ensure that the client closes the connection first . otherwise the said problem will POP up.
|
|
|
|
|
(SORRY FOR MY BAD ENGLISH)
hi for all
first i have this exception
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
then i add commons-logging-1.1.1.jar
to my library in Netbeans
after that i find this error
Exception in thread "Thread-7" java.lang.NoClassDefFoundError: org/apache/http/params/HttpParams
what will i do
and if any one have that jar for free please put it for me and thank you all
|
|
|
|
|
thank you all
i have just found it
i am sorry
|
|
|
|
|
Good for you. When this happens, it is polite to modify the subject line of your original post to add [SOLVED] or something like that.
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
thank you
is your replay about my new question socket?
and if it is
how can if modify the subject line ?
|
|
|
|
|
My reply is about this thread. Open your original message, and you will see an Edit link at the bottom. Click that and away you go.
You can modify any of your own messages this way.
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
hi
i am working with JML (java MSN library)
i found this code
but it doesn't work with me
any one help me please
this is the code
package example1;
import net.sf.jml.MsnMessenger;
import net.sf.jml.impl.MsnMessengerFactory;
public class BasicMessenger {
private String email;
private String password;
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
protected void initMessenger(MsnMessenger messenger) {
}
public void start() {
MsnMessenger messenger = MsnMessengerFactory.createMsnMessenger(email,
password);
messenger.setLogIncoming(true);
messenger.setLogOutgoing(true);
initMessenger(messenger);
messenger.login();
}
public static void main(String[] arg) throws Exception {
String args[]=new String[3];
args[0]="william";
args[1]="rojjffjjj887hghgma@hotmail.com";
args[2]="uullro33";
BasicMessenger messenger = (BasicMessenger) Class.forName(args[0])
.newInstance();
messenger.setEmail(args[1]);
messenger.setPassword(args[2]);
messenger.start();
}
}
|
|
|
|
|
williamroma wrote: but it doesn't work with me
That is not very helpful; try explaining what you think it should do and what results you get.
I must get a clever new signature for 2011.
|
|
|
|
|
|
i have to make a chat messenger
so i think that a JML is a good API to connect with MSN
i begin to learn about it and i find that code
but it doesn't work with me
any one know tutorial to use this API
any one konw where is the wrong in that code
thanks you all
(SORRY FOR MY BAD ENGLISH )
|
|
|
|
|
A quick Google located this site[^].
I must get a clever new signature for 2011.
|
|
|
|
|
yes i found that website
and the code i put here is the first example on that site
but in that site there is no explain for the code
i am realy thank you but i have to learn this API
|
|
|
|
|
williamroma wrote: but i have to learn this API
Well the logical place is the site I gave you the link for. If there is no documentation provided then you will have to do it the hard way by working through the code. If there is a forum on the site then post your question there as you are much more likely to find someone who understands it on that site.
I must get a clever new signature for 2011.
|
|
|
|