I am reading the serial buffer with readLine() method. The string returned by readLine() is in the format "str1 : str2". In a while loop when I use readLine() number of times for a response of serial port command I get weird output like this :
String1 : string1
SString11 : String2
StringString2 : String23
String4 : String5
But I need...
Hi,
I have a frame that has a table and an exit button. I want to add some data to my table, but this doesn't work correctly: when I open my frame at first, the data is OK, e.g., "Nima,Rahmani,...", then I click the exit button and open my frame again, the table now has "Nima,Rahmani,..." two times, and when I click exit button now, a...
Hi, I have an Enterprise Java web application that all of the business is migrated from client-server application. So I need to adapt all requirement including printing on every client (Using Dot Matrix / Plain text).
Printing requirement for client on separated client is they must get the report right away after the process is finished...
Hi experts
I am trying to get hostname/computer name using this method. Unfortunately i only can get localhost but not other computer.
private String getHostName(String _strIP) {
try {
InetAddress inetAddress = InetAddress.getByName(_strIP);
System.out.println("getHostAddress : " + inetAddress.getHostAddress());
...
I have application that look like below
without spring (prior)
UI-> service --> javabean
p.s: my ui call service (not using DI) and i want to remain this way
new service()
I want my javabean to do DI for certain bean from applicationcontext.xml file.
Should i use Applicationcontext.getBean(the ..xml) file in javabean or is th...
I am using maven to generate a website for a Java project, which uses APT "Almost Plain Text" as a wiki like markup. Maven takes this and turns it into XHTML.
I already have a custom template/skin that I am using for the site, but the index page will have a couple of extra custom design elements that are beyond the capabilities of APT. ...
Hey everyone!
I am studying Data Structures in java and I am having difficulty with using generics in Binary Search Trees.
For our assignment we are to implement a Binary Search Tree using nodes that contain a parent, left and right node as well as a data value.
The data value in our case takes the form of a Pair object. This is what i...
Problems:
I am unable to get the values of the JTextFields or the rollResultTotal to update.
Even if the data in the JTextFields are valid, a NumberFormatException is still thrown.
Questions: Why don't the variables stay? Is this due to declaration in the class itself? Is it possible to update a JLabel panel to show an updated resu...
I have seen some of our colleagues using _ [underscore] in front of class names [entities in JPA], and few more people using it for local variables.
Is there a standard[or atleast best practice] in java to use _ [underscore] in front of instance[private] instance variable or class name????
I have looked at the following link in SO [Sta...
I am currently new to web programming and is trying out to learn spring framework. I have basic understanding on Servlets and JSP.
Currently, I am confused on the property cacheSecond on the Spring Controller. Can anybody point me to resource where I could understand below concepts?
I made some reading on browser caching but I am not...
Hi mates!
I've a problem with GlassFish and SAP JCo connector (sapjco3.jar)
I load it at start up of an J2EE application (jwm.ear) and initialize it wrapped in a singleton the first time a connection to SAP is needed.
The problem is that this jar remains always initialized in memory, I need to restart glassfish to unload the initializ...
Is there any way to restrict a java project configured with 1.4 compiler compliance level from using 1.5/1.6 specific API where the system is playing with 1.6 JRE?
Setting only 1.4 compiler compliance level on my project does not warn me from using especially 1.5/1.6 specific java.lang.String methods.
...
In my project Spring manages connection pool with org.apache.commons.dbcp.BasicDataSource class. Is possible to get how many connections are free or used in current time?
Thanks.
...
I am testing my gae java jdo routines in eclipse.
The actual question is, how to clear/clean out the localhost development datastore so that I could start with a virgin datastore for a new cycle of tests?
Addional info - For those who don't know:
GAE = google app engine, google's "hosting solution" for java and python applications.
...
Hi!
I'm using JAX-RS to create restful webservices in Java. I am getting to much overhead in the produced JSON.
Data class:
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class Test {
private Map<String,String> data;
Test() {}
public Test(Map<String,String> data) {
this.data = data;
}
publ...
Hi,
I have a project A, which contains some java files and a classpath resource R.txt. Within the project I use ClassLoader.getSystemResource("R.txt"); to retrieve R.txt.
Then I have a project B which includes project A's jar-file. Now getSystemResource("R.txt") wont find the textfile (and yes, it's still in the root of the jar file)...
Hi,
I am trying to zip and encrypt files in Java (1.6) with a password based on the earlier Zip 2.0 encryption. I have used AES 256 bit encrytpion to encrypt zip files with password and have successfully been able to do so.
Though AES is a stronger and a more secure encryption standard, i need to find a standard that is more widely s...
I have to generate all variations without repetitions made of digits 0 - 9.
Length of them could be from 1 to 10. I really don't know how to solve it, especially how to avoid repetitions.
Example:
length of variations: 4
random variations: 9856, 8753, 1243, 1234 etc. (but not 9985 - contains repetition)
I would be really gratefu...
Need to know about static tool analysis options via Eclipse plug-ins for Java code with framework especially for Struts, Spring and Hibernate. The purpose is primarily analysis (and not Quality metrics) of references (similar to References option in Eclipse). The task to accomplis is impact analysis for applications with a lot of framewo...
I've created a drop-down menu on my Swing JToolBar. But it doesn't create behave the way I want. I'm aiming for it to work like Firefox's "Smart Bookmarks" button.
It disappears when the user selects a menu item: CORRECT!
It disappears when the user presses ESC: CORRECT!
It disappears when the user clicks somewhere in the main frame o...