|
Hello,
I have a JTextArea in a panel,I am reducing its bounds and then printng it to graphics object.
But there is a problem with it the text on the right border gets cut...i am unable to understand why is it so.
|
|
|
|
|
Example code helps.
There could be any one of a thousand reasons it doesn't work, without code it is impossible to help.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
jComp.setBounds((int)Math.round(rectangle.getX()),
(int)Math.round(rectangle.getY()),
(int)rect.getWidth(), (int)rect.getHeight());
java.awt.Font font = fontSizeMap.get(jComp);
-------//jcomp is a jtextfield
jComp.print(graphics2D);
|
|
|
|
|
your problem is right in front of you, you are changing size of textAREA but i can't see font rules.
if you cant solve it, you might missed something.....
modified 27-Apr-12 7:16am.
|
|
|
|
|
I write a class ThreadPool that is extend from ThreadPoolExcutor. When I use it, I print out the result of CompletedTask after shutdown the ThreadPool, but it always not equal the total number of tasks.
I don't know why, please help me
|
|
|
|
|
I would hazard a guess that you have written non-thread safe code. Without seeing the code it would be very difficult to tell.
Look for updates and/or logic that relies on value that is accessed across multiple threads, this code will need to be synchronized to ensure it is safe.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
I am trying to write java code for querying ontology by sparql with jena .....but i search and I didn't find code
|
|
|
|
|
I searched for this:
google: querying ontology by sparql with jena
And got plenty of information. You're obviously not trying.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
I search on net and i found alot of sparql code but all codes wrong . i want understand how to write sparql code ,there are basics to write code not just copy and paste .....any way i got my answer by my self .thank you
|
|
|
|
|
Hi all,
It's been few days I have interoperability issue with service WCF(MICROSOFT FRAMEWORK.NET 3.5)deployed in IIS 7.5 and Java client Unit Testing Spring Framework. The service uses a MTOM property to send attached file in the SOAP Header request.
To check if my WebService works well, I developed a C# client and it works, my client .net can communicate with my service .net.
But the goal is to call this service with Java client.
I've done two test, one with SOAPUI and I get this error message :
"IIS 7.5 Erreur détaillée - 400.0 - Bad Request"
and the other one is with a Java client I got the same error message.
I do not have any clue about where does it might come from?
Moreover, I enable Java client and server side, the MTOM property even in SOAPUI.
If anyone got an idea or a solution, I will really appreciate.
Thank you.
My Configuraion Binding Java client Side (Context File) :
<pre lang="HTML">
<jaxws:client id="myService"
serviceClass="myServiceSoapBinding">
<jaxws:outFaultInterceptors>
<ref bean="clientWSOutFaultInterceptor" />
</jaxws:outFaultInterceptors>
<jaxws:binding>
<soap:soapBinding version="1.1" mtomEnabled="true" />
</jaxws:binding>
<jaxws:features>
<cxf:fastinfoset />
</jaxws:features>
</jaxws:client>
|
|
|
|
|
Hi. Sorry, I am fairly new to Java. I am trying to read data from an XML file into an ArrayList. Here is the code:
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;
public class XmlParser {
public void UserListParser() throws ParserConfigurationException{
DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
builder = dbfactory.newDocumentBuilder();
XPathFactory xpfactory = XPathFactory.newInstance();
path = xpfactory.newXPath();
}
public ArrayList<User> parse() throws SAXException, IOException, XPathExpressionException {
File f = new File("../../../../../users.xml");
Document doc = builder.parse(f);
ArrayList<User> users = new ArrayList<User>();
int count = Integer.parseInt(path.evaluate("count(/users/user)", doc));
for (int i = 1; i <= count; i++) {
String username = path.evaluate("users/user/[" + i + "]username", doc);
String password = path.evaluate("users/user/[" + i + "]password", doc);
String perms = path.evaluate("users/user/[" + i + "]permissions", doc);
User u = new User(username, password, perms);
users.add(u);
}
return users;
}
}
I keep getting 7 errors, each error is one of the following and they are on lines 20, 22, 31, 34, 37, 38 and 39.
"Cannot find symbol"
symbol : variable builder
"Cannot find symbol"
symbol : variable path
Appreciate any help and thanks in advance. The XML file is below:
<?xml version="1.0" encoding="ISO-8859-1"?>
<users>
<user>
<username>User1</username>
<password>Password1</password>
<permissions>axxx</permissions>
</user>
<user>
<username>User2</username>
<password>Password2</password>
<permissions>xsxx</permissions>
</user>
<user>
<username>User3</username>
<password>Password3</password>
<permissions>xxbx</permissions>
</user>
<user>
<username>User4</username>
<password>Password4</password>
<permissions>xxxm</permissions>
</user>
</users>
|
|
|
|
|
You are trying to use some variables without declaring them so the compiler has no idea what they are supposed to be. Having given you the source line number and name of the variable you can go to that line and correct it by adding the type declaration before the variable name. See this tutorial[^] for some more detail.
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
Intialize the builder and path variables , It will work..
Like mentoined below
public class XmlParser {
DocumentBuilder builder =null;
XPath path=null;
public void UserListParser() throws ParserConfigurationException{
DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
builder = dbfactory.newDocumentBuilder();
XPathFactory xpfactory = XPathFactory.newInstance();
path = xpfactory.newXPath();
}
|
|
|
|
|
Hey!
I'm searching for a proper way to create serial numbers for use with one of our Apps.
I've also found some tutorials etc, but none that really tickled me.
Some even seem to be a bit "home made" with wild String operations and stuff like that.
Do you use serial numbers? If yes - what system do you use
|
|
|
|
|
Is it server based?
A reasonable approach would be to use a cryptographically secure pseudorandom number generator[^] with the seed generated from the machine's MAC address. A similar approach would be the same with the registered e-mail address's hash-code as a seed.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
thanks for the link, I'll see how I can integrate that...
|
|
|
|
|
Depends what you want it for. Identification of users or versions for support queries? 'Locking'/registration-required hard to break ones? Machine-unique ones? Is it a client/server app or a standalone one?
|
|
|
|
|
Stand alone - with a small service at server side...
I think I'll try to create some using the MAC Address, that is a good idea and should work on all OS.
Let's find some wild ideas...
|
|
|
|
|
Hai Guys,
Can anybody help me to develop a telephone interface application in java.I am a beginner in this Voip type application.I need the algorithm for that.
|
|
|
|
|
muhammed_k wrote: Can anybody help me to develop a telephone interface application in java.
No, but we can help with specific technical questions. The basic research into a subject is something you have to do for yourself. Look at the Java articles here on CodeProject and try searching with Google for other resources.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
K ,I am collecting the basic document for this project.Thanks for the reply
|
|
|
|
|
hi, guys.
i want to make an application which can set the permission file (many file),and this application can detect the file automatically based on the ip address from active ip address client side.
then, server just click one button to set these file become read only. this aplication will developed use java RMI.
i need your help, to solve it. i had looking for some of information about it, and i had tried to start it too, but i'm still confused with it.
|
|
|
|
|
dnafrinsi wrote: i want to make an application which can set the permission file (many file)
OK, have you checked which Java class you can use to accomplish this?
dnafrinsi wrote: this application can detect the file automatically based on the ip address from active ip address client side.
Do you know of some method whereby a client will notify a server of file changes?
dnafrinsi wrote: then, server just click one button to set these file become read only.
Who will click the button?
dnafrinsi wrote: this aplication will developed use java RMI.
Right, at least you have one subject that you can spend time studying.
dnafrinsi wrote: but i'm still confused with it.
Try breaking your project into its constituent parts (I've had a go based on your questions) and address each part in turn. When you have one piece working you can move on to the next part.
There is not a lot more we can do to help at this time since you have not really explained which part you are stuck on.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
maybe , first, i want to set file become read only.
i think it's the first step which shoud i do.
u can give some help, probably.
oya, thanks for your advice.
|
|
|
|
|
dnafrinsi wrote: u can give some help, probably.
Of course, see here[^].
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|