Java is a general-purpose programming language designed to be used in conjunction with Java Virtual Machine (JVM). "Java platform" is the name for computing systems that have installed tools for developing and running Java programs. Use this tag for questions referring to Java programming language ...

learn more… | top users | synonyms (6) | java jobs

0
votes
0answers
2 views

Java EE 7 Security not redirecting users to the login page

I am having trouble getting unauthenticated users to be forced to login before viewing the web app. The setup is Java ee 7, Glassfish 4.0 and the IDE is Netbeans 8.0 I am using form based security ...
-4
votes
0answers
7 views

Is that program look good for read doc id and store some location

import java.io.InputStream; import java.util.Properties; import com.documentum.com.DfClientX; import com.documentum.com.IDfClientX; import com.documentum.fc.client.IDfClient; import ...
0
votes
1answer
15 views

Why my Icon is not changed in JFrame?

Here is my Code in java that i have written. A screen shot of my Laptop is attached which is showing output in which java icon is still there on (left corner). import javax.swing.*;![enter image ...
0
votes
0answers
4 views

Android Linkedin Api and Making REST Calls

So, I've been working on a project for couple weeks now using the linkedin api and have hit a dead end. I'm making a linkedin android application that requires the following information: User's first ...
0
votes
0answers
2 views

Create SVG in Java/Android

Is there any simple way to create (and read) SVG in Java? I would like to refresh this question SVG building library for Java as 3 years have passed, and I consider batik a bit heavy for mobile ...
0
votes
0answers
28 views

Can anyone explain why my arrays aren't printing correctly? [on hold]

I'm not very good at programming so I was looking for an explanation for why my code isn't working correctly. First of all the arrays aren't printing at all and then when i try to take the average of ...
0
votes
0answers
7 views

Is there any way to schedule push notifications past two weeks using the parse interface?

I want to use the parse.com interface to schedule a series of push notifications throughout the year. Right now it seems to limit it to just two weeks. I want to use the parse.com interface instead ...
1
vote
1answer
41 views

Not understanding the 'volatile' keyword

This is a Thread Class. public class Processor extends Thread { public boolean running = true; public void run() { while (running) { ...
0
votes
0answers
7 views

BarChart Overlapping Data Ruins Chart

I have a BarChart filled with a bunch of data. It works fine when the X-values don't overlap. As soon I try to add in a data node that overlaps with another though, it knocks the old one out of ...
0
votes
0answers
13 views

Download a file without buffer: Nio is faster than io?

I'm developping an updater for my project, and i want to download files quickly. Per update, there are some files, which have a different size. So i think i don't needed a Buffer, or surely not ...
0
votes
1answer
15 views

Get sms message before it hets to the main sms app and change it's body

Is it possible to cech sms message before it gets to the main sms app and change it's body?
0
votes
1answer
18 views

Reload a browser in java

Hi guys I create a browser with this code and now I have to reload the browser (the browser is in my "java window") final Browser browser = new Browser(shlFreeViews, SWT.NONE); ...
0
votes
0answers
12 views

Scale Bitmap to fill screen

I am trying to make a livewallpaper from a bitmap array. I have everything in place so that it cycles the pictures but I cant seem to figure out how to make the images(bitmap) scale to fit the screen. ...
0
votes
1answer
29 views

pseudocode for loop to java for loop

how do I translate the following pseudocode to java code: for k:=0 to (j - i - 1) { a[j-k] :=a[j-k-1] } This is part of the insertion sort code from a discrete math book, I'm confused if I ...
0
votes
0answers
3 views

Hibernate Search equivalent which works with EclipseLink

Is there an equivalent of Hibernate Search which works with EclipseLink? If using EclipseLink as jpa provider, what are my options for performing full text search on my entities?
1
vote
2answers
21 views

Java: insertion sort trouble with array size

I'm trying to write a sorting program that will ask a user what type of sorting method to use (insertion, bubble, selection) and then ask him to enter integers to sort. I think I have everything ...
1
vote
0answers
10 views

Selenium browser usage detection

I am testing my website using selenium browser from both java and python API. Is it possible to natively detect the Selenium as a browser(firefox is beeing used as a driver for tests) or do I have to ...
0
votes
2answers
31 views

Ordering array by a property in Java

I have an array of objects in Java. Let's say Product products[]. Each of those products have a price, for example, product.getPrice(). What's the best way I can order that product array by the ...
-1
votes
0answers
5 views

Using proguard with libGDX and AdMob

I am trying to build my android app using proguard and libGDX. I tried adding the lines contained here (http://developer.android.com/google/play-services/setup.html) to the proguard-properties.txt ...
0
votes
2answers
27 views

How do i make the variable bleed work with both of these events

@EventHandler public void onEntityDamageByEntityEvent(EntityDamageEvent event) { if(Math.random()<=0.02) { Entity e = event.getEntity(); int bleed = ...
-1
votes
0answers
10 views

how to get immediate response from JSF action

I'm using JSFunction to run a JSF action in JSF application . i'm using a JSFunction to perform a background heavy calculation using JSF Action. My problem is that when i call this JSFunction from a ...
0
votes
0answers
17 views

Java Invocation Target Exception [on hold]

this program is throwing an Invocation Target Exception. How can I fix this? Credit for the original program goes to the contributors below. The game object is a class with the variables boardString ...
0
votes
0answers
8 views

Database logging : which technique?

I'm using JBoss EAP 6.2.0 for a Drools rule engine project. Drools has event-listener logging, and I want to make a database table with logs of the rule activations, etc. There will be lots of ...
0
votes
1answer
11 views

How to use setOnClickListener and setOnTouchListener + for

Why can not I use setOnClickListener and setOnTouchListener in my program? OnTouchListener works well, but I cen't run new activity? what am I doing wrong? for (final ShopCategory category : ...
0
votes
0answers
16 views

JavaScript UI With Java Base

I'm working on an application written in Java, which is my main programming language. However, the GUI's Java provides are not exactly fitting for my needs. I've been struggling to create something ...
0
votes
2answers
27 views

java regex replace any double letter in word with single

I've been searching for hours but can't find an answer, I apologize if this has been answered before. I'm trying to check each word in a message for any double letters and remove the extra letter, ...
0
votes
1answer
26 views

Java Knights Walk Algorithm (Brute Force)

I am trying to write a Knights Walk Algorithm(brute force) using Java. I was able to create a program to move through a 5x5 grid but the program always leaves out 06 cells out of the board. And my ...
-5
votes
0answers
22 views

How to split up a string without a symbol in Java

How do I split up the string 81X2MRT1C1EJYL0C F8QFIIN56PUIKM7U so that "-" is between every 4 letters and " " should make it a new line For example: 81X2-MRT1-C1EJ-YL0C F8QF-IIN5-6PUI-KM7U
0
votes
0answers
3 views

How to create Glassfish json request/response web services

I am trying to figure out the easiest way to build JSON web services using Netbeans and Glassfish server. Netbeans provides some nearly fully automated ways of creating RESTfull web services from a ...
0
votes
2answers
12 views

android unable to start Main activity in options menu

Hi there basically i have created a options menu and have one of the menu items as the home button which essentially calls the home activity Main.java. I have used the code startActivity(new ...
0
votes
1answer
34 views

Why I do not can delete the file in Java?

Pleade help me! I do not understand why Java dont want to delete the file! I basically want to lock a file to avoid that my jar-file can start more than one time. Then after the action I want to ...
0
votes
2answers
41 views

Why do you have to specify method return type in Java?

Sometimes I see methods declared like this: public MethodName() { ... } other times, I see methods declared with a class defining the type they are returning(?). For example: public ClassName ...
0
votes
0answers
16 views

Frame only appears some of the time java

For some reason (seemingly completely independent of code) the frame of my program will only appear some (maybe 20%) of the time. If I just continuously hit run I evently get the frame to show ...
0
votes
1answer
23 views

How do I clear from the println() command on Java? [duplicate]

all! Is there any way to remove text that has been printed to the console? I can write a message easy enough with System.out.println("Hello world!"); but how do I remove it once it's been put up? ...
1
vote
2answers
55 views

Does immutability guarantee thread safety?

Well, consider the immutable class Immutable as given below: public final class Immutable { final int x; final int y; public Immutable(int x,int y) { this.x = x; ...
0
votes
1answer
19 views

java.lang.NullPointerException for AlertDialog (Android)

I am trying to implement Parse Cloud Backend for password resets. I am running into an NullPointerException when I try to get the value out of an editTextField from within an AlertDialog. The ...
0
votes
0answers
8 views

Extracting XML from HTML file from URL in java

I have a piece of work where I need to extract the HTML content from URL. And in HTML file contains the href link which contains an XML data. I need to extract it and parse it to fetch xml data. ...
0
votes
0answers
14 views

Connecting Java TCP Chat client over the internet?

The program I have been working with works both as a host/client GUI chat. For now it only works on localhost. When I try connecting to the program as a client over the internet using my public IP it ...
0
votes
0answers
3 views

Android Jsoup.connect(String).execute() fails

I'm attempting to access selected data from the html table that is returned from http://reednavigation.com/lunars/lunars_v5.asp (full path works in browser and can be found in code below in the ...
0
votes
1answer
6 views

Need help launching Android Studio with Java in different installation location

I'm trying to launch Android Studio (64-bit) by clicking the icon on my desktop. When I use the studio.bat file to launch Android Studio - 64-bit AS launches and runs fine (however, the CMD window ...
0
votes
0answers
10 views

How can I update Eclipse's jre location via command line?

I have a (python) script that unpacks the latest Java JDK into /opt/java/jdk, and I would like to update Eclipse's notion of where the JDK, javac, jre, etc are located via that script. We would like ...
0
votes
0answers
5 views

Hadoop: synchronization while updating file in HDFS in the Map stage using Filesystem.append()?

I'm wondering if Hadoop has any sort of synchronization protection when multiple nodes try accessing the same file on HDFS using the FileSystem append(Path p) method? I append values to a text file ...
-1
votes
1answer
36 views

How do I generate a Matrix style output

I'm trying to get an output of a random string consisted of 1's and 0's in a Matrix style. I know how to display a string consisted of 1's and 0's, but I can't keep on looping through it for some ...
0
votes
2answers
14 views

Not sure how to display results in a new activity using Android

Hi i have a problem and i am new to android development... i want to display the results in a new activity once the submit button is pressed instead of using the toast feature but i am not sure how i ...
0
votes
4answers
28 views

Why doesn't Integer objects Unbox when compared with `==` operator?

Because sometimes it gets confusing. Lets say: Integer start=new Integer(10); Integer mid=new Integer(10); Integer end=new Integer(20); System.out.println(start<end); // gives true ...
1
vote
1answer
17 views

Document.toString() is “[#document: null]” even though XML was parsed

Consider this example @Test public void testXML() { final String s = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><results>\n" + " ...
0
votes
0answers
6 views

Implementing responsive resizing in a LibGDX game?

I've been experimenting with small games to learn design concepts, LibGDX, and Box2D. I am wondering how you would implement "responsiveness," so to say. For example, this is the rendering part of my ...
0
votes
0answers
5 views

Tabs and custom content in one activity/fragment

I want to create a layout like in this picture, but I dont know how can I create it. Can someone give me some tutorial or example how can i create a activity/fragments like on the image? Thanks
0
votes
0answers
8 views

how to create TimePickerDialog using FragmentDialog

I want to create a TimePickerDialog using FragmentDialog and exchange data between my fragment and the TimePickerDialog . I already created a DatePickerDialog but I don't know how to create a ...
2
votes
0answers
14 views

Android - Setting a Background across 4 ImageViews

How can I achieve the effect that 4 Imageviews have one specified part of a background? I want to get this effect: WP 8.1 Home Is there any way I can do this? Thanks.