Questions tagged as 'java'

1
answer

Attempt to invoke virtual method 'void android.widget.ListView.setAdapter (android.widget.ListAdapter)' on a null object reference

I am trying to make an item list view with titles, prices and category of gasoline, to be seen in this item list view. I am new to android and I am not sure that I could have failed in my code. My project manages to compile and execute but wh...
asked by 07.05.2018 / 04:54
1
answer

Error getting data from a Spinner

I'm getting some data from 3 spinner and I get an error, it says it's a null object, however, this same code works for me in another activity, only now I'm using it in a fragment and it gives me an error. This is the logcat 05-03 23:14:29.9...
asked by 04.05.2018 / 02:22
1
answer

How to save a shopping cart in Android Studio?

I am designing a shopping cart on android, and I would like to know how to store the data it stores. or what ideas can you give me to save this data in a database. Because if I only save the variables, only enter the last element shown...
asked by 14.05.2018 / 01:03
1
answer

How to insert data and create tables in Java Derby JDCB

I'm trying to run a program for employee entry checks I use the Derby driver in eclipse oxygen. Reading I came across some information and it was very similar to php and prepared statements, my problem is that when running my code the database w...
asked by 14.05.2018 / 17:19
1
answer

Any type of Java overflow?

was doing the problem # 2 Project Euler and suddenly notice that when the numerical quantities were high negative numbers were positive and positive, in C ++ I also had the same, someone knows why this is given? public static void main(String...
asked by 29.05.2018 / 17:00
1
answer

com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect integer value: 'null' for column 'YearPublication' at row 1

I'm creating a web application about selling comics in java, it turns out that at the moment of "insert" I get that error that showed in the title. Insert.jsp HTML code <%@page import="java.sql.DriverManager"%> <%@page import="j...
asked by 18.06.2018 / 22:22
1
answer

Calculate how many hours and minutes have passed since a date in Java [closed]

I want to save the current date (day + time + minutes) in a database and then retrieve it in Java and calculate the difference in hours with respect to the current date. However, I would like that the time was not obtained through the system,...
asked by 17.06.2018 / 11:09
2
answers

List an array of objects from JQuery, RESTful service using @GET, Java HTML

I have a RESTful service which stores data through a JQuery that sends a json to a POST method that inserts the object into the database. I also have a method that reads the records from the base, and stores them in an arrayList of objects, w...
asked by 17.04.2018 / 04:17
1
answer

How to load a background image in a Java Canvas

Hello! I need to upload the next image in a Canvas that I'm using This is the code which is loading the canvas public JFrameJuegoBase() { initComponents(); canvas = new CanvasDibujable(); canvas.setBounds(30,...
asked by 11.04.2018 / 00:23
2
answers

Problem updating Listview when adding item

I have a problem updating the listview , I add the new contact all right (it is saved in the SQLite database) but it does not update the new record in listview . The code I have is: public class ContactosDetalle extends Activity...
asked by 14.04.2018 / 00:23