Posts by Antonio Santos • 758 points
34 posts
-
-1
votes1
answer32
viewsA: How to reference properties of a userForm to a sub in excel?
You solved it, but I have a more generic solution: If you pass the Checkbox as a parameter, you will not need to reference userform in your method and so you can pass any object. Sub ChecarCkb(obj…
-
0
votes1
answer18
viewsA: Msgbox when he can’t find the search doesn’t show up
Hello. I didn’t look at all the code, I looked at where you’re in trouble. Follows correction: Sub MSIAPE() Application.ScreenUpdating = False Dim MSIAPE As String Dim Celula As Range Dim Valor Dim…
-
0
votes1
answer163
viewsA: How do you know which worksheet line the selected listview item is on?
You can load the list through a For and the first column put the row that the record is in, but you leave this column with the width reset in the table. Ex: Private Sub CarregarListaEmail() Dim ws…
-
1
votes1
answer1060
viewsA: Using Seekbar in a simple way
To control audio from your device use the class Audiomanager. private AudioManager audioManager; private void configuraAudioManager() { //Configuta AudioManager audioManager = (AudioManager)…
-
1
votes1
answer541
viewsA: Take the value of a variable in Seekbar - Java / Android
For you to get the value of Seekbar: seekBar.getProgress(); And within the method onProgressChanged(SeekBar seekBar, int progress, boolean b) progress is the second parameter int progress And to…
-
2
votes2
answers314
viewsA: Navigation Drawer customized and colorful
In the onCreate() of his ActivityMain puts the code below: NavigationView navigationView = findViewById(R.id.nav_view); // Aqui com certeza você já faz // A linha abaixo permite você visualizar os…
-
1
votes1
answer58
viewsA: Error javax.el.Propertynotfoundexception: Array index out of range: 0 Java JSF intersection exercise
The problem is: for(int i = 0; i < valorA.size(); i++) { for(int j = 0; j < valorB.size(); j++) { valorA.size() and valorB.size() will be equal to zero since nothing has been added yet. No…
-
1
votes1
answer231
viewsA: Problem with JSF2 + CDI + Tomcat
You are only using the cdi api. You need the implementation as well, since Tomcat does not implement cdi. <dependency> <groupId>org.jboss.weld.servlet</groupId>…
-
2
votes1
answer114
viewsA: Screenupdating x On Error Goto Errorhandler
Application.ScreenUpdating = False Disables screen update and always at the end of the code you have to activate Application.ScreenUpdating = True. Does not interfere with On Error GoTo ErrorHandler…
-
1
votes1
answer159
viewsA: Read xml with Xstream
Use Filereader to read your file and pass as parameter in the method fromXML(fileReader). public static void main(String[] args){ FileReader reader = new FileReader(new File("C:\\remessa.xml"));…
-
3
votes1
answer2005
viewsA: not-null Property References a null or Transient value
Basically, you are calling a persist in the City entity that has the state attribute set to nullable = false, therefore, if you do not define this attribute, JPA / Hibernate will not allow you to…
-
1
votes4
answers66
viewsA: Add 0 to the left in an Arraylist <Integer>
But for numbers smaller than 10 I would like to add 0 before type: 01,02...10. Only with String.format("%02d", 3); already solves this formatting you need.…
javaanswered Antonio Santos 758 -
2
votes2
answers372
viewsA: How to show 2 rows in Listbox
Try it that way: Private Sub Pesquisar_Click() Dim nApol As String Dim nApolBanco As String Dim nlin As Long Dim Linha As Range Dim arrayItems() Application.ScreenUpdating = False If…
-
3
votes1
answer529
viewsA: Send a Servlet object array to a jsp page
You store as an attribute in your request: @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String[] array = {"gato", "rato",…
-
4
votes1
answer1238
viewsA: JPA error with Mysql 8
You can start informing your Entity in the persistence.xml file: <persistence-unit name="persistence_elysium"> <!-- provedor/implementacao do JPA -->…
-
2
votes1
answer91
viewsA: Grab mouse position inside scroll pane
I have an example I made recently to move my window. Check if the code below helps in the solution. double xOffset = 0; double yOffset = 0; scrollPane.setOnMousePressed((MouseEvent event) -> { //…
-
0
votes4
answers940
viewsA: Java: How do I store a vector in another vector and using Math library
The variable c is only visible in the first for, but since arrays have the same size you can use the variable i for the two arrays. public static void main(String[] args) { int[] num = new int[5];…
-
1
votes2
answers345
viewsA: Edittext vehicle mask
I made an example that might suit you. public static void main(String[] args) { String pattern = "HHH-HHH"; String numeroProcesso = "ABC123"; System.out.println(format(pattern, numeroProcesso)); }…
-
2
votes1
answer1096
viewsA: Apply Mask to Java back-end
One way to solve your problem would be by using the Maskformatter class. Example: public static void main(String[] args) { String pattern = "##/###.###/####"; String numeroProcesso = "010000012018";…
-
2
votes1
answer73
viewsA: Is it possible to use libraries within the structure of the java project?
Test with the code below and check if it solves. <img src="<%= request.getContextPath()%>/newLib/minhaLogo.png" width=30>
-
0
votes1
answer208
viewsA: How to download data from firebase by Storage?
Use a library that comes with Firebse Torage. In your build.Radle add the line below in dependencies so you can use this firebase feature: implementation 'com.firebaseui:firebase-ui-storage:0.6.0'…
-
2
votes2
answers1131
viewsA: onDataChange(), in addListenerForSingleValueEvent(), is only executed after my method returns
This happens because the firebase data recovery process runs in the background, or better in the background, so the return will always be false. You can enable a dialog before starting the…
-
1
votes1
answer194
viewsA: Navigation between screens (Javafx)
When you create the second Stage, set the setOnCloseRequest method as below by placing a method that loads the data into the contact table. When the second Stage is closed this method will be…
-
4
votes1
answer201
viewsA: ZIP code search via VBA programming
When you enter the URL a "/" is missing after "http:" "http://republicavirtual.com.br/web_cep.php?cep="
vbaanswered Antonio Santos 758 -
4
votes3
answers209
viewsA: Polymorphically manipulating subsclasses
Polymorphism is the ability of a method to act in different ways, depending on the object about which it is being called. When a method is called, the JVM decides which method to invoke depending on…
-
1
votes4
answers6070
viewsA: Excel VBA - Runtime Error '13': Incompatible Types
Put . Text in place of . Value in if tests. Count = 0 For x = 1 To LastRow If Cells(x, 8).Text = "Materiais" Or Cells(x, 8).Text = "Imobilizado" Then If Cells(x, 11).Text= "NÃO CATALOGO" Then Count…
-
0
votes2
answers138
viewsA: Implement Paint in Javafx
Example of an application, but using fxml. FXML: <?import java.lang.*?> <?import java.util.*?> <?import javafx.scene.*?> <?import javafx.scene.control.*?> <?import…
-
1
votes3
answers1866
viewsA: Formatting date in Java web with Primefaces
Test with the code below: <p:column headerText="Data de Início" filterBy="#{projeto.dataInicio}"> <h:outputText value="#{projeto.dataInicio}"> <f:convertDateTime…
-
1
votes1
answer108
viewsA: report filter excel
In Userform1 use the code below: Dim wsR As Worksheet Dim wsD As Worksheet Dim ul As Long If cdDataINI <> "" Or cdDataFIM <> "" Then Set wsR = ThisWorkbook.Sheets("RELATORIO") ul =…
-
3
votes3
answers3521
viewsA: Failure of RANGE class SELECT method
You do not need to select Sheets("SINTESE_LOCAL") or cell "D1". Exchange your Macro1 code for: Sub Macro1() Sheets("SINTESE_LOCAL").Range("D1").Value= "L" End Sub
-
1
votes4
answers141
viewsA: Is there performance gain using . replace() instead of . put() in a Map?
If you use put() with an existing key, it will be overwritten. The map doesn’t have duplicate keys. You use replace to overwrite and put to add, but put does both.
-
0
votes4
answers141
viewsA: Is there performance gain using . replace() instead of . put() in a Map?
Take this simple test: public static HashMap<String, String> Lista = new HashMap<>(); private static void methodTeste1(String teste, String outra) { for (int i = 0; i < 100000; i++) {…
-
1
votes2
answers54
viewsA: Problem in the JSP Controller class
Why do you use the update method Feature() before going to the edit screen of that employee’s data? This step should only be directed to the edit screen and from there you submit the data to update.…
-
1
votes2
answers180
viewsA: How to ignore sentence and case in Java . startsWith
Try to do as below: e.getMessage().trim().equalsIgnoreCase("/reciclar")