Questions tagged as 'java'

3
answers

Method parameter with abstract class

Hello. I think my question is very simple, but I really did not find any solution after much research. In Java, I have two concrete classes that extend an abstract class, as the example: public class Animal {} public class Dog extends Anima...
asked by 24.04.2015 / 01:45
1
answer

How do I set margin in a TextView in java source code?

When I'm in xml , it only applies the property: android:margin="15" I want to apply this same property, but in the source code of java , how do I do this?     
asked by 24.04.2015 / 02:20
1
answer

How to transform an image into a qr code with Zxing?

I'm developing an android application capable of generating and reading qr codes, the application already encodes and decodes strings, but now I need to do this with images. I have tried some ways to transform the image into an array of bytes...
asked by 18.02.2015 / 07:37
1
answer

Application error on heroku

I made an application using IntelliJ using the database and everything is working very well, but as soon as I gave push to Heroku, a message appeared:    Application Error. An error occurred in the application and your page could not be ser...
asked by 13.02.2015 / 13:27
1
answer

How to reduce a decimal number in java?

For example ... Calculating 8/6 will have a periodic tithe with a value equal to 1.333333 ... But I only want to show the user only 2 digits after the comma, that is, 1.33. How can I do this?     
asked by 19.02.2015 / 21:07
1
answer

Change object in another method

What is wrong with changing an object, which was passed to another method?, eg: public void doSomething(User user){ edit(user); //... EntityManager.persist(user); } public void edit(User user){ //... user.setName("new name...
asked by 20.02.2015 / 19:04
1
answer

Failure in swing application response

I have a swing application in which I verify whether the word entered is right or wrong. String palavra[] = new String[3]; palavra[0] = "bar"; palavra[1] = "ola"; palavra[2] = "alo"; String p = jTextField1.getText(); int cont = 0; while (cont...
asked by 16.04.2015 / 03:41
1
answer

Error statement and executeUpdate SQL - NetBeans

try{ Class.forName(driver); Connection conn = DriverManager.getConnection(str_conn, usuario, senha); Statement stmt = conn.createStatement(); String sqlinsert ="insert into cheque (data_cheque,valor,repasse) values ("+...
asked by 30.01.2015 / 18:30
1
answer

Problem with database insertion

I have the following code on my system: public int insert_dependente(Dependente dependente) { ResultSet r; int result = 0; if (!(dependente == null)) { try { Connection conn = new Conexao().getConnection();...
asked by 18.05.2015 / 00:17
1
answer

Save images from the server in my application

I'm developing an application that once installed, the first time it is initialized it goes to the server to fetch all the images necessary for the user to use the application. I chose the Picasso library to manipulate my images but I do no...
asked by 19.01.2015 / 14:35