Posts by Gustavo Cinque • 594 points
41 posts
-
-1
votes2
answers199
viewsA: Change the input Mask when the select value is changed
Assuming you are using ngx-Mask, a different solution is proposed on the module page. <input mask="(00) 0000-0000||(00) 0 0000-0000" /> With this the mask will behave like cell phone when you…
angularanswered Gustavo Cinque 594 -
0
votes1
answer269
viewsQ: Use of HTML rendering tag in Jboss Seam PDF
I need to present texts with changed background color and in different fonts within an html rendering tag, but the correct value is not shown. Tag used: <p:document…
-
0
votes2
answers25
viewsA: Do not include class specifics in the table filter
Use the pseudo css selector not applied over their tds. Example: #myTable tr td:not(.hiddenTd) { color: white; background-color: blue; } <table id="myTable"> <th> <td>Header…
-
0
votes2
answers58
viewsA: Add Elements from one class to an arraylist in another class
If you need an instance of CustomerService throughout the execution of your application, I recommend following a Singleton standard: public class CustomerService { private static CustomerService…
-
0
votes1
answer120
viewsA: While error in joption pane: loop
Are you checking to see if sexo difere de F ou sexo difere de M Table tests: true ou false = true // Input = M false ou true = true // Input = F true ou true = true //Input != F e M That is why it…
-
1
votes2
answers81
viewsA: How to get the value of one table depending on the maximum value of another?
Using a sub select would look that way, in my view: SELECT O.nome, SUM(E.saude) as somaSaude FROM Objecto O, Elemento E, composto C WHERE O.marca = C.prodMarca AND C.produto = O.codigo AND…
-
2
votes3
answers142
viewsA: Help with java arrays
public static void main(String[] args) { String[] a = {"teste1", "teste2", "teste1"}; String[] b = new String[a.length]; for(int i = 0; i < a.length; i++) { if(arrayNaoContemString(b, a[i])) {…
-
1
votes1
answer24
viewsA: pass objects from one class to another
There are several ways. One of them is to use a constructor in your class Main: public class Game { public static void main(String[] args) { Main main = new Main(new Team(), new Team()); } } public…
javaanswered Gustavo Cinque 594 -
0
votes1
answer314
viewsA: Java. how to display a string array from a menu option?
The error happens because you instantiate the vectors every time you rotate the while. Follow the correction, made by bringing the lines of the vectors above in the code: package br.com.alura.teste;…
javaanswered Gustavo Cinque 594 -
2
votes3
answers1141
viewsA: How to create an element search method in an Arraylist?
The easiest way is: Arrays.asList("Débora", "Luan").stream().filter(string -> string.equals("Luan")) .collect(Collectors.reducing((a, b) -> null)).get(); Or even, what would be more protected…
-
1
votes2
answers276
viewsA: Help with Java Exercise
It happens because your first Scanner#nextInt() does not consume the last newline of the expression, only consumes the whole value and leaves the newline unchanged. Therefore the nextLine which you…
-
5
votes2
answers141
viewsA: Inheritance class Object
But how does the compiler know that all created classes should take this pattern? It’s the pattern that was created. During the development of languages, it was defined that, at the top hierarchical…
-
1
votes1
answer218
viewsA: Capture webcam images every 1 second using Javacv
You can use the class Timer for that reason. Just create a Timer, and set a TimerTask that does what you need within the method run(), for example: Timer timer; public void criarTimer(int segundos)…
-
0
votes1
answer241
viewsA: How to generate JAR and POM project by following the Maven repository layout?
It can be done by setting a profile and its directory within the pom.xml: <profiles> <profile> <id>novoProfile</id> <build>…
-
0
votes1
answer148
viewsA: White Space selectOneMenu
Friend, the problem is not in jsf, but in its logic to the popular the list of String. If you need the file name to be completely empty, do not include it in listaFiles, just do not insert in…
-
2
votes1
answer692
viewsA: File . properties in java code
You could use the ResourceBundle, with it you can access the files that are in the system’s Resource folder. Example: public class ResourceUtil { private static ResourceBundle bundle; static {…
-
1
votes1
answer458
viewsA: org.hibernate.Propertynotfoundexception: Could not find Setter for sum on class Class
Using Hibernate Query Language (HQL) (or JPQL, cannot differentiate them), you induce the compiler to believe that there is an attribute sum inside ItemPedidoVenda. To solve you could create even…
-
1
votes2
answers763
viewsA: Recover the value of an attribute of a generic object in Java
From a single entity, for example Entidade, you will need to have inside her a Map<String, Object> mapa. To each value obtained from xml, vc will assign to the object used mapa.put(colunaXml,…
-
5
votes3
answers426
viewsA: When should I wear the new one or not?
@Aline, do not use new in def data = Date.parse('dd/MM/yyyy', '31/12/1980'), for Date#parse(String, String) is a static method not a constructor, and looking at the class Date, this method returns…
-
2
votes2
answers195
viewsA: How to check data range?
Come on. I will try to use a pseudo code, because I have no basis in php. Given the various: horaEntradaBanco = registroBanco.horaEntrada; horaSaidaBanco = registroBanco.horaSaida; horaEntradaMarkup…
-
1
votes1
answer165
viewsA: Doubt Receiving parameters (Webservice Soap)
Come on. When you give an @Override on Cancelar()you are not missing the implementation of the interface, precisely because there is none, being it an interface. What may have led you to believe…
-
1
votes1
answer155
viewsQ: What dependencies in Maven to use Jqwicket to integrate Wicket and Jquery
I am developing a Wicket-Hibernate-Spring project. Until the communication and persistence of objects in the bank, it was working normally. After some time, with some scope increase, I need to use…
-
2
votes2
answers472
viewsA: @Autowired bean in Filter
Only @Components(@Services, @Repositorys, and @Controllers) can be instantiated as @Autowired within other components, or @SpringBeans within noncomponents. That’s why Spring scans classes with…
-
1
votes2
answers2030
viewsA: Customize Youtube Player in Iframe
Felipe, after my research, I found some information. That one video which explains how to use Google’s native tool for modifications. The import system is extremely easy to use and learning, since…
youtubeanswered Gustavo Cinque 594 -
0
votes2
answers6070
viewsA: Convert Jtextfield to integer and save to bd
Considering a treatment for the value of jTextField: String valorTextField; Integer valorIntegerTextField; try{ valorTextField = campoTextField.getText(); //Capturo o valor do campoTextField e…
-
14
votes1
answer10089
viewsA: Difference between Integer.valueOf(String) and Integer.parseint(String)
There’s not much difference. In fact the Integer.valueOf(String) returns a new Integer(Integer.parseInt(String)). then he uses Integer.parseInt(String) within himself. Observing the codes, the…
-
2
votes1
answer435
viewsA: How to update a Jtextarea with information from Jcheckboxes?
As I said, in the method listener the correct would be to add the value of texto1 in textArea1, getting something like this: public void actionPerformed(ActionEvent e) { Writer writer; try { String…
-
5
votes1
answer3610
viewsA: Monetary mask for Jtextfield
The easiest way, @Rodox, is to use the class MaskFormatter. First you create a class instance MaskFormatter with a constructor in this format: MaskFormatter mascaraCampo = null; try { mascaraCampo=…
-
1
votes1
answer423
viewsA: show on the screen the position content?
There is a logic error when presenting the space the user chooses: First, but without affecting much, is that you are giving a scanner.nextInt() even when the user type something that is not…
-
1
votes1
answer869
viewsA: How to do basic mathematical operations?
What must have happened, Edson, is this: I select number 1: The reading value, which was 0, is multiplied by 10, remaining 0; The reading value and incremented by 1 to 1 screen. I select operation…
-
2
votes3
answers391
viewsA: Doubt in Arrays - Beginner
for (int i=0; i <= this.empregados.length; i++) { System.out.print("Funcionario na pos.: " + i); System.out.println(" Nome:" + this.nome); } @Victor, the this that you use in line 3 of the…
-
1
votes1
answer906
viewsA: Doubts in the use of the dataExporter
I’m going to leave a table that I created here and it worked, creating the columns, each with its name. The only divergent thing is that I created an xls file, excel. <p:dataTable…
-
1
votes1
answer756
viewsA: Relationship between entities
Solved. After asking the question here, the program executed the exclusion function of livro, what had not happened before to publish the question (Sigh). Even so, the exclusion function of autor I…
-
1
votes1
answer756
viewsQ: Relationship between entities
I am unable to make the deletion of the selected object. I have two classes, Autor and Livro, Basic example of working, to learn the use of Java Server Faces, so far everything well, functioning and…
-
3
votes1
answer668
viewsA: java.lang.Outofmemoryerror: Java heap space
What is happening is that there are many connections in memory management. One solution is to close the session with session.close() every time you finish using it a method that communicates with…
-
0
votes2
answers464
viewsA: Error class expected!
On line 11: idades[i] = int.parseInt(JOptionByte.showInputDialog("Informe a idade")); You cannot use the primitive type of a class to make method calls, so the correct one would be…
javaanswered Gustavo Cinque 594 -
5
votes5
answers6853
viewsA: Convert Date field data to Mysql month
The need would be to create the field, the column: ALTER TABLE tabela ADD COLUMN mes VARCHAR(255); And after that run the update: SET lc_time_names = 'pt_BR'; UPDATE tabela SET mes = (SELECT…
-
0
votes2
answers1203
viewsA: Characters Invisible
After some research, I found that the standard "CP1252" is the default Windows standard, also known as "Windows-1252" or ANSI. When using the character map for another pattern of my code, the…
javaanswered Gustavo Cinque 594 -
1
votes2
answers1203
viewsQ: Characters Invisible
Setting up a web example, when I received a string for the projection in html from the application, I noticed an inconsistency. I would like help with this. In one of the moments of creating the…
javaasked Gustavo Cinque 594 -
0
votes2
answers801
viewsA: How to change the value of a property given its name
I do not know if it is possible to execute directly in this format. What would work is you check which value of the variable change and use an if, with the definitions since there are few…
-
2
votes1
answer137
viewsA: What is the difference between these two statements?
In the first example, you’re taking the class instance RequestContext and inserting into a variable "local" (RequestContext requestContext) where its maintenance alters the status of the "Singleton"…