java

java

  • All Sites

1 answer

Seperate BigDecimal Fraction Part

I need to separate fractional part from BigDecimal and convert to Integer. Eg: 1.05(BigDecimal) => 5(int) 1.30(BigDecimal) => 30(int) Note: Decimal part won't exceed 2 digits

1 answers | 12 secs ago by Afil Ansari on Stack Overflow stackoverflow.com
0 answers

JavaFX simple app in OSGi bundle don't work out of eclipse

I had a lot of problem to create an OSGi bundle that use the JavaFX API and I finally get it work. But I can't make it work out of eclipse. I use Equinox with felix file install, and here is my ...

1 answer

Which would create more memory footprint, appending on StringBuilder or adding ArrayList<String>?

StringBuilder sb = new StringBuilder(); while (read line from File) { sb.append(line).append("\n"); } or List <String> lines = ArrayList<String>(); while (read line from File){ …

0 answers

Sending sms in java using smslib

i want to send sms in java. i have configured gsm modem. i am using smslib for sending the sms. here is my code SerialModemGateway gateway = new SerialModemGateway("modem.com34", "COM34", 115200, ...

1 answer

Using Axis1 over https

how are you? Well, the problem is that we are using Axis1 to consume a wsdl based webservice which works fine when the URL where the WSDL is located uses plain old HTTP connection, but when it uses a …

1 answer

Hibernate @Formula isn't working

In this hibernate pojo the @Formula isn't working for the PAIS_CD parameter, in runtime: @Entity @Table(name = "PAISES") public class Pais { @Id @Column(name = "PAIS_CD", unique = true, …

1 answers | 2 mins ago by Ronaldo Veras on Stack Overflow stackoverflow.com
1 answer

How can i get request in Filter

I want to log all requests and messages of request body in My REST Web Service Project. I use Spring and json message conveter. But I face with java.lang.IllegalStateException: getReader() has already …

0 answers

Java classloader fails to load java classes in native thread

I have a java application that loads a c++ dll. It all works fine I can call different function but there is one issue. I am creating a new thread in my C++ code that is a listener and calls a ...

0 answers

how to make when selecting items from 2 comboboxes dyanamically link to 3 rd combobox in java swings netbeans?

I am creating two comboboxes and inserting some elements like suzuki,Honda,activa into first combo and Renault,Indica,Benz into second combo box, and also i am creating 3rd combo which has nothing to …

4 answers

ConcurrentHashMap putIfAbsent : atomicity when followed by a get() call

I wanted to discuss a specific use I have of a concurrent map to sense check my logic... If I used ConcurrentHashMap, I can do the familar private final ConcurrentHashMap<K, V> map = new ...

0 answers

HTTP Status 500 - Request processing failed; nested exception is java.lang.NullPointerException for my project

I Can't redirect to webstore because of this error. Anyone know this? Below here is the coding part: @RequestMapping("index.htm") public ModelAndView indexPage (HttpServletRequest request, ...

0 answers

Java8 - how to know if daylight savings is on now

I need to find out whether daylight savings is on now using the new Java 8 datetime classes. I found an entry how to do this in jodatime: jodatime how to know if daylight savings is on But how can I …

3 answers

represent a fractured time range in REST

i am trying to design a rest api which accepts a query parameter specifying a date range.For a simple time range i do it like &st=1407772800000&et=1408432033709 representing the start time …

3 answers | 3 mins ago by austin on Stack Overflow stackoverflow.com
5 answers

Java align JLabel in center of JPanel

I have a bar at the top of my application that has a number of buttons either side of a JLabel. The button's visibility is dependent upon the current task a user is carrying out and one of the ...

4 answers

Force next word to a new line if the word is too long for the textview

I have a TextView, that when filled programmatically will not properly line break on words. Current Output: This is what's happening: | Hi I am an examp | | le of a string t | | hat is not break | …

4 answers | 6 mins ago by i_me_mine on Stack Overflow stackoverflow.com
1 answer

Add images to the form in java

I want to add the image and the file with the same form in JSP. how should i do it? Here, i made the form as: <div id="user_img"> <form name="form1" method="post" ...

1 answers | 8 mins ago by Puru Chauhan on Stack Overflow stackoverflow.com
4 answers

How to deploy/upload a JSP file on Server

I have created a jsp file which will give an output in JSON format using java class and servlet, i am new to java and i don't have idea about the deployment of jsp file. Can anyone suggest me how to …

0 answers

How to get currently entering text in JTable?

i am developing a project. On that i need to get currently typing characters in a particular column of JTable. If i am using, table.getValueAt(table.getSelectedRow(), 1) it will return nothing …

1 answer

Spring Example “Securing a Web Application”

Is the Spring framework example titled "Securing a Web Application" (at http://spring.io/guides/gs/securing-web/) wrong? I've tried it line by line but the "Set up Spring Security" part (at ...

2 answers

What Concepts of Java do i need to learn to use Selenium Webdriver?

I want to learn Selenium WebDriver automation using Java. I have done manual testing before and want to learn automation. I just know the basics of Core Java. Could you please suggest me the Core …

2 answers | 11 mins ago by Drew on Software Quality Assurance & Testing sqa.stackexchange.com
1 answer

Regex parsing issues of multi-line entries containing formatted text

I have an internal system log file which I have been parsing via and external Hive table and a Regex statement. But recently, issues in the output data have emerged with parts of the XML data ...

1 answers | 11 mins ago by Dom on Stack Overflow stackoverflow.com
1 answer

CntDwnTimr deliver random numbers with 2 sec delay+no duplicates

In this code I have a countDownTimer which delivers a random number every second. The numbers appear in a TextView. What do I have to Change in my code, that the textView updates every second second …

1 answers | 11 mins ago by ANDROID_DEV on Stack Overflow stackoverflow.com
10 answers

Cannot change version of project facet Dynamic Web Module to 3.0?

I am confusing with the question just like the title. It happened that I using maven to create a dynamic webapp in eclipse, subsequently I followed someone's guide to make some change, adding some ...

10 answers | 12 mins ago by EdgarZeng on Stack Overflow stackoverflow.com
1 answer

Eclipse exported Runnable Jar not showing images

My images will not load when running a JAR file exported from Eclipse. I have the images in a resources class package... I've tried a images source folder as well with no luck. Works perfectly when …

4 answers

How does Java determine uniqueness of Hashmap key?

I want to maintain a list of objects such that each object in the list is unique.Also I want to retrieve it at one point. Objects are in thousands and I can't modify their source to add a unique id. …

4 answers | 14 mins ago by Aneesh on Stack Overflow stackoverflow.com
0 answers

httaccess find last name after slash to redirect to an other page

I want from htaccess url like this example http://www.clubrowcreations.co.uk/marketing-mistakes-general/thank-you all url end with (/thank-you) redirect to main url how do i do from htaccess

1 answer

spring data paging with start and end counts

I'm using spring data with mongodb and have issue which is described below. Pageable pageRequest = new PageRequest(page, count); return projectRepository.findAllByUserId(userId, pageRequest); from …

1 answer

Multiplayer Java game - program freeze when starting Server via GUI

I'm writing a Java GUI multiplayer game. I have a GUI where user can enter port number and click on "start server" which will initiate game server and bring up another GUI frame. But my program ...

1 answer

Spring Data JPA xml configuration : “Table not found” with create-drop

I probably forgot something in my conf somewhere and i can't figure out what. I have an @Entity : @Entity public class MyEntity implements Serializable { private static final long ...

0 answers

Regext to extract PATH + QUERY + FRAGMENT

For some platform issues, I cannot use java.net.URL So I am doing this pure regex style: My goal is to extract "domain" and "path + query + fragment" in a given complete URL. I managed to extract …

15 30 50 per page
1 2 3