Tagged Questions
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 ...
0
votes
0answers
4 views
Yahoo Login (HtmlUnit)
I'm writing a simple tool to interact with Yahoo, but I can't seem to be able to log in using HtmlUnit library. Here's the code:
WebClient webClient = new WebClient(BrowserVersion.FIREFOX_24);
...
-1
votes
0answers
6 views
How can i use google places api in my java web application
am trying to develop a web application which takes two places and determines the distance between them and also intermediate locations between them. I found that places api will be helpful. How can i ...
1
vote
3answers
10 views
Add month with JodaTime?
I'm trying add month with JodaTime. I have a payment plan with some months, example: one month, two month, three month and six month.
When I add six month at DateTime doesn't work and return an ...
0
votes
0answers
14 views
SQLite Error Code near “IS”
I'm breaking a rule while creating my SQLite database table and I'm unsure how to fix this issue.
public void onCreate(SQLiteDatabase db) {
String CREATE_ALARMS_TABLE = "CREATE TABLE " + ...
0
votes
1answer
12 views
Overlapping of two Date Range
Given two date ranges, whether the two date ranges overlap?
As an example, suppose we have ranges denoted by DateTime variables StartDate1 to EndDate1 and StartDate2 to EndDate2.
eg:
(A) ...
-1
votes
0answers
4 views
Sending a non-threadsafe class over the network
Apache's org.apache.http.entity.mime.content.FileBody is @NotThreadSafe. Can I safely pass multiple post requests having such FileBody over the network. A sample would be via ...
0
votes
0answers
3 views
Eclipse RCP - Add submenu to existing file menu
I want to add submenu to existing file menu.
I tried below:
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
...
0
votes
0answers
42 views
Java HashMap cant find a key when its clearly present
I have a hash map defined as:
private final Map<Integer, Integer> myAppMap = new HashMap<>();
I remove entries from the map like this like this:
myAppMap.remove(users[index].id);
...
0
votes
0answers
6 views
android is not recognized as an internal or external command [how to install android command]
I am trying to convert Volley to a jar file. However a step in the guide has me input
"android update project -p .
ant jar "
but I get that android is not a command. I have never used this command ...
0
votes
0answers
37 views
JAVA: Code review list [on hold]
I am been reviewing code review checklist and i could not get the below points clearly. I have looked around the net bet could not get hold on below points. Rest of the points I am clear. Please help ...
0
votes
0answers
9 views
Why is SavedRequest null in Java Spring app?
This is related to a previous question : How to intercept request in servlet filter first before it hits the login jsp in Spring MVC?
I did some research and found there is a SavedRequest object that ...
1
vote
1answer
30 views
Can use functional operations
I'm using the for-each construct in Java as follows:
public int getNumRStations() {
int numRoutes = 0;
for (ArrayList<Route> route : routes) {
numRoutes += route.size();
}
...
0
votes
0answers
6 views
Aspectj:Use AspectJ to monitoring the method which accesses the database?
I want to use AspectJ to monitoring the database statement,I define the pointcut as
@Pointcut("execution(* java.sql.Statement.execute(..))")
it can't work.
but want I define the pointcut as
...
0
votes
0answers
8 views
Any suggestion to reproduce no response C/S application
Any suggestion to reproduce no response C/S application?
Background:
Developer one POS application, less use mouse.
I guessed there might have one scenario that the popup window lost focus, because ...
-6
votes
1answer
42 views
the meaning of “public static void(string[] args)” [duplicate]
being new to java programming and a novice learner, specifically looking at the command
public static void main(String[] args)
what does public static void mean ? and what are terms like args meant ...
1
vote
1answer
18 views
Java idiom for non-SAM lambdas
In Java, classes with a single abstract method (i.e., SAM types) can be elegantly implemented with lambda instead of an anonymous class:
// SAM ActionListener with anonymous implementation
...
0
votes
3answers
52 views
How can I communicate between multiple classes?
I have three classes. For example's sake, I'll call them AwesomeClass, CoolClass, PrettyClass. AwesomeClass instantiates an object of CoolClass and PrettyClass. Now, I want CoolClass to change a ...
1
vote
1answer
10 views
Tomcat hangs due to large requests
I have a Grails application which is deployed in Apache Tomcat server. Everything works fine but sometimes the application receives around 100-200 requests in succession(Due to an API integration and ...
0
votes
0answers
7 views
Robospice-retrofit testing
I'm trying to do some unit-testing using this robospice-retofit example. The problem is i got some NullPointerException when I call the loadDataFromNetwork() method. Here's the testing code
public ...
0
votes
2answers
21 views
User Input Issue in Java
I'm trying to make a program that is similar to a Type To Learn program and eventually develop it into an app. I'm aware that it's really easy to just have a button that checks whether the user input ...
1
vote
0answers
11 views
BeanUtils/Template behaviour with private classes
When Using beanutils , I encountered a behavior which I didn't understood
I have created a template class like below example,
class A <T> {
public c methodB(T t){
C c;
...
1
vote
3answers
17 views
Something's wrong with my endTime in java
I am trying to add a StartTime and EndTime to my java GUI as there will be multiple batch files running which will close one cmd, start another cmd, close this cmd and start another till all batch ...
1
vote
1answer
27 views
Why am I getting java.lang.ArrayIndexOutOfBoundsException
So basically, I'm trying to make a grid of 144 buttons (12x12) by making 12 rows down with 12 buttons along each row.
However, when I try to run, I get this error:
Exception in thread "main" ...
0
votes
1answer
17 views
Is String.format %d always compatible with BigInteger?
Using String.format %d and its variants, we can easily format the primitive integers and longs.
However, does these formatting options work perfectly with BigInteger?
I've made some tests, and they ...
0
votes
0answers
10 views
Android Dynamically Populate MapView from JSON
I'm attempting to populate a Mapview/MapFragment in Android with JSON. I'm basing my code off the tutorial ...
0
votes
1answer
10 views
How to create page object in java for selenium webdriver?
I want to automate a page by creating a page object for login page in which the below field are our requirement on which I have to automate :
Give username.
Give password.
Click on login button.
...
0
votes
1answer
15 views
inquiry about final word in java object oriented programming language [duplicate]
just want to know why i should use final word in next code, and can i dispense it ?!
import javax.swing.JButton;
import javax.swing.JFrame;
import java.awt.BorderLayout;
import java.awt.TextArea;
...
0
votes
1answer
8 views
EditTextPreference validate upon entry of text
I have a problem when trying to validate text upon entry of text, I have a hint that a user should follow 'GXW-999' is an example, this is my code:
`public final static String[] PATTERNS = ...
0
votes
1answer
6 views
What all to download for Google Cloud Storage api java?
I'm trying to follow the documentation on how to use Google Cloud Storage with the new clients API. so i started on the downloads: ...
0
votes
0answers
7 views
Equivalents in C Sharp of Java's NavigableMap.floorEntry, ceilingEntry
I have used the NavigableMap interface many a time in Java, it's handy.
Specifically, I like to use its floorEntry and ceilingEntry methods, which get you the next lowest or highest map entry, ...
0
votes
0answers
10 views
Robot crosses boundary on collision rather than bounce back while implementing particle filter
I have written the following code, where I am trying to create a particle filter. The problem I am facing is that even after using intersects method and other conditions, the robot sometimes overlaps ...
1
vote
2answers
14 views
How to set the height and width of jpanel
Here is my code:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Main extends JFrame implements ActionListener {
private JPopupMenu popup;
private JMenuItem ...
0
votes
0answers
4 views
how to know the subclass of mapping in hibernate
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public class A{
private long id;
}
@Entity
public class B extends A{
private String bProperty;
}
@Entity
public class C extends A{
...
-1
votes
0answers
16 views
Setting up a minmum age and maxmimum age argument
I am working Parse, and with support I have created a profile creation page where users fills out a variety of creation such as:
Minimum age requirement
Maximum Age requirement
I have been able to ...
0
votes
2answers
13 views
How to retrieve text of TextView[] from viewpager within main Activity {NPE}
I have a TextView[] object and a String[] field in a Fragment. I have 5 Fragments in total, all handled by a ViewPager. I want to retrieve pretty much all of the Strings displayed in each Fragment ...
0
votes
1answer
19 views
Java Server/Client socket stops responding
I am having trouble with my client/server program. The server is supposed to get a file from the client then convert it to xml, and then stream the xml file back to the client.
As of now everything ...
0
votes
0answers
8 views
Minecraft Modding, hitEntity method not running
I am fairly new to modding and, I want to create a sword that sets mobs or players on fire. I am using the hitEntity method and, I noticed the function is not even running. I tested it using the ...
0
votes
0answers
7 views
getDefaultGcsBucketName contained no data
I'm using app engine 1.9.7 sdk and attempting to follow the documentation on Google Cloud Storage client access. i'm trying to find the default bucket name (so i can test things out with the free ...
-1
votes
1answer
27 views
Java inheritance and super method
I have an object of StatCalc which uses getMethods to display in a driver class under main methods. However instead of modyfing StatCalc which has sourcecode. getAvg, getSum, getCount etc...
I have ...
-12
votes
0answers
45 views
java finding number that has exactly 3 divisors [on hold]
hi guys i need a way to find out if a number has three positive divisors,
eg the number 2 is a prime number therefore false
the number 4 is divisible by 1,2 and 4 therefore true
the ...
0
votes
0answers
3 views
poi product function produces an unexpected floating point approximated value
I am using apache poi 3.10-FINAL version to read a couple of cell values and multiply.
I am multiplying two cells, each with value 38.15 & 199.1, but the result is 7595.664999999999 instead of ...
0
votes
0answers
9 views
JRE crashes in Eclipse since upgrading to Ubuntu 14.04
I've been developing Android apps on Eclipse 4.2.2 and Java 1.6.0_21 on Ubuntu 12.04 LTS without any problems. Recently I got an upgrade notification for 14.04 and so I upgraded. Now I keep getting ...
-5
votes
0answers
17 views
How to remove HTML tags only inside flower braces in java? [on hold]
How to remove HTML tags only inside flower braces in java?
eg. i have a content like this I/P:
"<-Span->{Test {Table}<-BR->Test<-/BR->}<-span->"
and i want the output ...
0
votes
1answer
18 views
How to get text from an instance of a radio button class created
This code runs but the new problem is that I am able to select more than one radio button in each section which is not supposed to happen.
Also, it calculates the scores wrong. Please can someone ...
1
vote
0answers
12 views
Can't change Android ImageView's Y in Java file
I am trying to make a Helicopter-like game (as you can probably tell, I'm using "Rocket Man" instead of a helicopter). I'm new to Android programming and to Stack Overflow, so don't pick apart my code ...
0
votes
2answers
20 views
Android tcp socket can not receive data
I am trying to work with sockets in android programming, sending to the server works fine but i have problems with receiving a string from the server.
the socket is connected, but if the server is ...
0
votes
0answers
9 views
JAXB POJO's generated from WDSL seem cumbersome to use
I'm not new to SOAP and turning WSDL's into POJO's. I've managed to connect to the web service and retrieve the data I need.
The problem rests in traversing the object hierarchy that the WSDL ...
-1
votes
1answer
28 views
Maven set up questions
I just started using researching Maven and am trying to figure it all out. I had to use it with this online tutorial in mongoDB i'm taking to run maven on a couple of different pom.xml files to build ...
0
votes
1answer
19 views
How to set image wallpaper, when user click on Image?
I am new to coding and never worked with it before! I am working on wallpaper application were I created the gallery . I managed to do this , but I want to modify the app so that when user click on ...
-4
votes
0answers
19 views
I am getting an error everytime i time i compile the following code in Java! It says: non static variable cannot be referenced from static context [duplicate]
I am a newbie to java and also to StackOverFlow!! Please help!! :)
import java.io.*;
import java.util.*;
class SelectItem
{
Scanner sc= new Scanner(System.in);
String eggs,milk,bread,butter,yn;
...