Questions tagged as 'java'

1
answer

Final local variable in inner class in Java 8

There was a change between Java versions 7 and 8. Where in Java 7 for a local variable to be used within a inner class it should be declared final . Now compiling with Java 8, this local variable is no longer required to be declared...
asked by 02.06.2017 / 14:07
1
answer

How to print a list in Java? [closed]

I've been studying the OOP course in Java, and the teacher has spent a lot of time writing the code. Then I have a doubt! I have 3 classes in java. The class SalaAula, Pessoa and Professor. SalaAula.java import java.util.Scanner; public c...
asked by 04.06.2017 / 23:06
4
answers

How to parse on Json Android

I need to parse to the following json { "rssEmpregados": { "pesquisa": "marcia", "registoInicial": "0", "ordem": "ASC", "parametrosList": [ { "parametros": [], "ta...
asked by 29.11.2017 / 20:17
1
answer

Method does not return boolean true even if it is positive

I have a project account that makes a deposit, but I'm not able to return a true even if it finds the value in the database This is my class account method public boolean depositoConta(double deposito) { System.out.println("Metodo de Dopos...
asked by 19.11.2017 / 16:00
2
answers

Configuring Hibernate transactions only with Jersey API annotations

I want to use something similar to org.springframework.transaction.annotation.Transactional of Spring that sets up a Transaction only using only the Jersey API. Something similar to the code below: @Resource private SessionFactory facto...
asked by 17.02.2014 / 20:36
2
answers

JDialog does not draw the components in Java

I'm developing an application that will execute a processing soon, and I want a message warning that the process is running stay on the screen while it does this processing. I tried to do with JOptionPane , but since it is a modal window b...
asked by 21.03.2014 / 19:20
1
answer

Delete a string with replaceAll

I have a string, example: &texto-outroTexto=09213sdadwqWDQS Where "09213sdadwqWDQS" would be any text and "&texto-outroTexto=" would be a fixed text. I wanted to do the Regex of this string. I did it that way, but i...
asked by 30.05.2018 / 19:21
1
answer

Read file located in another Package

Ihave3packages,onewheretheguiclassislocated,anotherwhereitwillbethe"scripts" of reading data (in main) and photos and text files in the resources. File file = new File("/com/Convocatoria/resources/DB.txt"); Scanner sc = new Scanner(fi...
asked by 02.06.2018 / 11:29
1
answer

Doubt to create and work with class array in JAVA

I have a program with 2 classes. The player class that contains only the name attribute: public class player { String name; } And I have the Main class that has the function below and the same call in main Public class Principal{ public s...
asked by 08.06.2018 / 06:43
1
answer

How to swap the JOptionPane background with an image?

Can you use this " ImageIcon " as the background for JOptionPane ? Here is the code I tried: public static void main(String args []){ UIManager UI = new UIManager(); ImageIcon icon = new ImageIcon("Imagens/Imagem.jpg"); //D...
asked by 21.04.2017 / 01:23