Questions tagged as 'java'

1
answer

Is it correct to declare GET / SET methods within a STRATEGY class?

I was left with a question when I created a design pattern of type Strategy . Is it correct to declare methods GET and SET in a class that implements a Strategy interface? I do not know if I was very clear, follow the example:...
asked by 04.12.2015 / 17:20
2
answers

Array diagonal in java

Firstly, I would like to inform you that I am new here on the site, and if by chance my question was left uninformed or poorly organized please speak. I was trying to solve this question: Iwasabletodevelopthiscode:importjava.util.Scanner;...
asked by 22.11.2015 / 23:06
2
answers

List years in JCombobox dynamically from given rule

I have an application that lists records in a JTable , and each record has a record date using Date . In this list, I put a filter per year via JCombobox , where the initial year is what the application started to use (2013)...
asked by 16.12.2015 / 12:01
1
answer

Change button color at runtime

I asked for help on how to paint a button with 3 different colors: can put 3 colors on a button? But I'm trying to change its color at runtime and I can not. Same instantiating a new one and replacing it. The button class is this: cla...
asked by 08.10.2017 / 20:31
1
answer

How to pass values by reference in Java?

Gentlemen, one of the methods of class Array has method sort . The sort method works like this: Arrays.sort(vetor); The vector itself is changed, I searched in many places and by what I understood this is passing valu...
asked by 06.10.2017 / 23:16
2
answers

Java Desktop Application Audit Log

Thinking about a Java desktop application that is running in a company, we may come across situations where the user may cause flaws in your application, in this case could create a in> error and an audit to know which error was caused and ho...
asked by 21.10.2015 / 14:12
3
answers

Put information in field fields of a URL and send it to the server with a program language

It is possible, using a programming language, to access a web page with login and password data, to set login and password information and to "click" the submit button, and can enter the site with your credentials? After this you can browse t...
asked by 12.02.2014 / 19:26
1
answer

Convert Stack Trace to String in JAVA

What would be the best way to convert Stack Trace from Exception to String ?     
asked by 08.11.2016 / 14:00
1
answer

NullPointerException error in java

I have a class of type User that has as attribute a vector of Sensors , and class Sensors has as attribute a vector of Data . After creating five User objects and saving them to a txt file, I populated 3 Sensor objects...
asked by 21.07.2015 / 01:02
2
answers

Should the Domain layer depend on Infrastructure?

I'm reading the Evans book on DDD and I came across the following quote:    The Infra layer does not perform any action on the domain layer, because it is below it, because it is below it should not have specific knowledge about the domain it...
asked by 08.07.2015 / 02:43