Questions tagged as 'java'

1
answer

Android: NullPointerException in .getIntent (). getExtras ()

I'm in an android class project and I have it almost finished but I need to pass some variables from one activity to another, it gives me NullPointerException and looking for I have not found anything.    Logcat       Caused by: java.lang.Nu...
asked by 11.01.2018 / 19:32
2
answers

Chinese characters are not printed when connecting to sql from java

I'm doing a function that all it does is print all the values of a field in a table, however I have Chinese letters saved in the database, and from sql server they look good, but when printed in java it shows only question marks, this is my func...
asked by 30.01.2018 / 21:32
2
answers

How to run Java applications (.jar) without installing JDK - JRE on the computer?

Good afternoon, it happens that I made a Java application that uses external .jar for reports and other functions of the application. Also use SQLite. NetBeans by default creates a folder called 'dist' that contains the executable nameapp.jar; a...
asked by 29.01.2018 / 00:05
2
answers

Launch commands from Java

I try to launch a command in Linux with Java with sudo and I can not find the way. I tried the following, but ... even though from the terminal it works, since the execution of my program it does not. public Boolean activarServicio(){...
asked by 30.08.2017 / 21:54
1
answer

Initialize SharedPreferences from a class that does not extend from activity

I am trying to get an app to start automatically when the device is turned on as long as the user wants. To do this, I save the value of a variable using SharedPreference . The problem is that for this I use Read and Save methods, that bei...
asked by 25.07.2017 / 08:21
2
answers

Contraindications to static import?

I'm analyzing a code and I found the class Constantes , which, as its name suggests, has this structure: public final class Constantes { public static final String PREFIJO = "prefijo_"; } In another class I saw this import :...
asked by 11.04.2016 / 13:14
4
answers

Filtering Dates and obtaining Dates in java

I have a list of objects and each has a date type calendar . I want to create a filter given two dates that I search for all objects between those dates. I would also like to create a method that calculates me given today's date which i...
asked by 14.01.2016 / 18:07
2
answers

Verification of types in Java

I need to know if Java has a constructor that can not do data type verification statically and what it does, if it does the verification dynamically or leaves the construction without verification during execution.     
asked by 18.06.2016 / 00:13
2
answers

Error when implementing comparable generic list

I'm trying to compare the values within my nodes with the Comparable interface. But when implementing the method compareTo I get an error: It says that the operator can not be applied to <E> (which is my generic value)...
asked by 30.03.2018 / 23:46
1
answer

Problem with several && in jFrame

I have the following code where I have to control if a food has x ingredients, the thing is that if you meet the ingredients but you select one more, you also consider it good because the code is as follows if(radioLentejas.isSelected()){...
asked by 17.04.2018 / 09:52