Posts by josivan • 752 points
24 posts
-
1
votes0
answers40
viewsQ: AWS Language and Environment
Knowing the Amazon AWS i was curious to know in which (or which) language it is implemented and in which web server(s) it runs. Searching, the most I found Amazon’s own page on the overall…
-
2
votes2
answers2461
viewsA: Delete repeats of values in Arraylist
The simplest way is to use an interface implementation Set. More precisely a java.util.TreeSet. For example: Set<Integer> semDuplicidade = new TreeSet<>(sequencia); // sua lista…
-
1
votes0
answers57
viewsQ: Transformer or Converter?
I have worked on some project and come across situations where a certain object has to be transformed into another. In general, these are java classes originated in COBOL that I convert to another…
-
0
votes1
answer170
viewsA: Relating Nodejs modules to Services Angularjs - Electron
You have to consider the architecture proposed by Electron. Note that the Node code, your service in the case, must be running main process (ipcMain). Consider this code your back-end which, in…
-
1
votes1
answer395
viewsA: Java null data insertion error, Java Postgre database
The object cha must be instantiated, received per parameter or be an attribute of the class containing the method cadastrarChamadas(). It must be something like that: public void…
-
2
votes1
answer86
viewsQ: java.io.Console when debugging in Eclipse
I’m trying to use the java.io.Console from within the Eclipse. However, whenever I call System.console() returns me null. In Jetty, it is possible to pass parameters on the eclipse console. For…
-
1
votes1
answer3763
viewsA: How to remove Duplicate Objects in an Arraylist?
You can and should use the Hashset, but the object you are adding to the collection should implement the method equals (and hashcode). For it is through the equals that the Hashset defines…
-
1
votes3
answers1666
viewsA: Rename gitignore.txt to . gitignore
On the command line type: ren .gitignore.txt .gitignore To access the command line from the current folder go to the address bar and type cmd. Via explorer just press F2 and remove the extension.…
-
2
votes2
answers1031
viewsA: Event click button
Keep everything in the loop and declare a final with what you want to write/manipulate. for(int i = 0; i <= 10; i++){ JButton bt = new JButton("BT : " + i); final Integer valor =…
-
2
votes2
answers2173
viewsA: Import class that is not inside an eclipse project
I’m sure they were. There are at least 3 options: The simplest is: Select project > Properties > Java Build Path > Libraries tab > Click Add External Class Folder > Select folder.…
-
0
votes1
answer91
viewsA: Error when injecting Service within a @Component
The annotation @Autowired will try to inject some class that implements the interface SimulationFlowService (or the classes themselves). Note that your class SimulationModelFactory is neither. Try…
-
5
votes3
answers6210
viewsA: What is the purpose of the symbol :: in Java?
It is a new feature of the language in version 8. Call Method Reference or Method Reference. The feature provides a way to reference a method without executing it. In addition, it is related to…
-
3
votes1
answer4298
viewsA: How do I edit the email in git?
A simple way is to edit the CONFIG file inside the . git folder There you edit the following: [user] name = seu nome vem aqui email = aqui vai seu email There are commands via command line, but this…
-
4
votes3
answers1175
viewsA: Using Double in the compareTo method
The autoboxing isn’t helping. Try to do it this way: return Double.valueOf(emp1.getPrecoMenor()).compareTo(Double.valueOf(emp2.getPrecoMenor())); I hope it helps.…
-
3
votes5
answers5903
viewsA: Capture filename in directory
Another approach is to use the library Apache Commons IO. It has several utility methods. For example the method listFiles(java.io.File, java.lang.String[], boolean). Where you define a root…
-
2
votes2
answers428
viewsA: Multiple sorts with Arraylist
You must use the interface Comparator. And in turn invoke the method Collection.Sort(List, Comparator); For example Collection.sort(list, new Comparator<Pessoa>() { public int compare(Pessoa…
-
7
votes3
answers1072
viewsA: What is and what is the function of . (dot) in POO?
You mean point operator (dot Operator)? According to the Java Tutorial available in this link. The point serves to: Code that is Outside the Object’s class must use an Object Reference or…
-
6
votes1
answer604
viewsA: Differences between listeners and Adapters in swing
In short, adapter is a project pattern where a class implements an interface nullifying (leaving no operations) the interface methods and you just override the methods that interest you, with the…
-
3
votes1
answer585
viewsA: Generate file . txt with three columns
If you know the width of the Column and it is fixed (I assume so, because it is for a matrix printer), you can use the method Stringutils.rightPad. Either way you will have to work with more than…
-
0
votes2
answers237
viewsA: Why isn’t jsf recognizing Istener in the Bean?
the a4j:support tag does not have a valueChangeListener attribute? If it does, it is the one you should use.
-
2
votes1
answer366
viewsA: How to fill an ontology from Java?
During my master’s dissertation I used Jena, which at the time was from hp. That was in 2012. I know that Jena was donated to apache. Take a look at the Apache Jena. The API to handle ontologies…
-
0
votes2
answers335
viewsA: How to iterate an attribute with Java Reflection?
Being very direct and without reinventing the wheel. Take a look at the Apache Commons Beanutils. There is even a method Beanutils.copyProperties who does exactly what you need. Keep in mind that…
-
5
votes8
answers5853
viewsA: Recognize word repeats in String
Hello. I made a very simple implementation. Essentially words are counted and a map is populated with words and the number of occurrences. I used the word as a key and quantity as a value. Then I…
-
0
votes3
answers14619
viewsA: java.lang.Noclassdeffounderror: Caused by: java.lang.Classnotfoundexception: When run . jar
Looking at the solace you’ve glued, the JRE is complaining of the following class: gui.tabelaLinhasonline.TesteLoteEstadoTableModel However, the code you pasted is of the following class:…