Questions tagged as 'java'

1
answer

Processing SQL statements with JDBC

I'm trying to use JDBC, but having difficulties with proper language use. I would like to pass the sql code down to java, and I need help with SELECT. Regarding the variables sql1, sql2, sql3 and the use of their respective where ... (for me...
asked by 19.11.2016 / 01:00
2
answers

Compare two list

I have a list List<Comentarios> comentarios List<Comentarios> comentariosSP The first list I get the data from a webserver, the second one from a SharedPreferences. I tried to compare them comentarios.equals(comentariosSP)...
asked by 05.11.2016 / 15:44
1
answer

How to align the column title of a JTable?

I have an (abstract table model) table and would like to center the column headings. I've tried the following: DefaultTableCellRenderer centralizado = new DefaultTableCellRenderer(); centralizado.setHorizontalAlignment(SwingConstant...
asked by 30.10.2016 / 22:40
1
answer

What is the best repository for Maven? [closed]

Sometimes I can not find dependencies in a repository, so where should I look for dependencies? Is there a core where all possible dependencies will be there?     
asked by 03.09.2015 / 03:43
3
answers

How to consider an empty EditText as "0"

I'm developing an Android app that calculates 3x3 arrays so I have 18 EditText , however if I want to multiply an array 2x3, 2x2, 1x2, etc. I would have to fill the fields the size of the array and leave the other fields with 0 and this w...
asked by 28.09.2015 / 14:39
2
answers

Evolve a basic class in Java

Hello, I have the following situation, I have an Animal object and I want to develop it for a Puppy: public class Animal { private boolean alive = true; public boolean isAlive() { return alive; }...
asked by 01.10.2015 / 21:16
1
answer

How to remove hover from menu items and buttons?

I think my question is quite objective: how to remove the hover effect from menu items and buttons? Here is an image of the hover effect that I want to remove (button and menu items):     
asked by 06.11.2017 / 20:23
3
answers

Execute block if an exception does not occur

I want to know if you have a function to execute, a block, if NOT an exception occurred in try {..} . Example: try { sout("Texto na tela"); } catch(Throwable t) { sout("Ocorreu uma exceção"); } casoNãoOcorraUmaExceção {...
asked by 31.05.2015 / 15:39
2
answers

Require that every instance has 2 attributes

Hello, I have a function class with attributes name, code and salary (all private), and a class Manager - which extends Employee - with the quantity attribute Employees, also private. How can I force every manager instance to have FunFunction...
asked by 07.06.2015 / 21:04
2
answers

Break a string containing a polynomial

I created a class with two properties as in the example below: class Polinomio { private int coeficientes; private int expoente; } I will create a list to receive a polynomial type where I will receive the terms to perform the addit...
asked by 03.06.2015 / 22:02