Posts by Pedro Afonso • 119 points
17 posts
-
1
votes1
answer33
viewsA: How to add items from a column in SQL
I believe that this SQL sums the quantities by grouping the items: select Cardapio.IndicadorSetor, Cardapio.NomeItem, SUM(AtendimentoItem.Quantidade) from Cardapio,AtendimentoItem group by…
sqlanswered Pedro Afonso 119 -
0
votes1
answer102
viewsA: Is it possible to change the color of a jtable cell of type Boolean?
In the class rewriting the method getTableCellRendererComponent it is necessary to create a Jcheckbox instead of returning the class itself, as the class creates a Jlabel for the cells. Therefore it…
-
-1
votes1
answer102
viewsQ: Is it possible to change the color of a jtable cell of type Boolean?
I am trying to change the background color of certain Jtable cells, but when I change the color of a Boolean column it loses the format of a Checkbox and appears written "true" or "false". I want to…
-
0
votes1
answer48
viewsA: Error to insert data into a table
You are giving select only in the a.email field, so you are only entering the email field in the #basehot table, and the error indicates that you cannot leave the COD_PES field null. Try to put…
sqlanswered Pedro Afonso 119 -
0
votes1
answer254
viewsA: Take text from excel cell
I don’t know if it’s the best way to solve the problem, but it was the way I was able to do it. First I copied my spreadsheet to another Workbook: Workbook wb1 = wb; Then I went through all the…
-
1
votes1
answer254
viewsQ: Take text from excel cell
I have an application that reads Excel data, but I can only read the value of the cell and I can’t read what the cell is literally showing. For example: Here I select where the spreadsheet is and…
-
0
votes1
answer128
viewsQ: Jscrollpane track which component is focused
I have a screen with a JSrollPane and several JTextFields. When I change textfield using the key tab, the JScrollPane does not track if the textfield that receives the focus is "below the screen". I…
-
1
votes1
answer148
viewsA: Write to worksheet from last line without overwriting
How I had already taken the spreadsheet and put in the variable sheet I just rewrote what I already had before I started writing the next part. I don’t know if it’s the best way to do it, but it’s…
-
0
votes1
answer148
viewsQ: Write to worksheet from last line without overwriting
I am trying to write in an excel spreadsheet from the last line written without deleting the content that already existed, I have already managed to pick up the last line and write from it, but when…
-
0
votes0
answers80
viewsQ: Problems with directory accents
I need to get the directory of a file that is inside the project, but the return is not respecting the accents of the folders. Class that searches the directory: package NewClass; import…
javaasked Pedro Afonso 119 -
2
votes1
answer145
viewsQ: Jcombobox popup is visible until you click the arrow
I have a JComboBox populated with Jcheckbox’s working normally, but when I click on an item, the Jcombobox popup closes. To see if Jcheckbox has actually been marked, it is necessary to open again.…
-
1
votes1
answer141
viewsQ: How to show only folders in Jfilechooser?
I have a JFileChooser and I need it to show only folders, but I can only show at least one type of file or show all types. Follow example code where I restrict to a file type: package NewClass;…
-
0
votes1
answer249
viewsQ: Select all Jcheckboxes by clicking button
My application has a list of JCheckBox within a Box. I want to make a button to mark all of them, but my code is giving the following error when I click the button "java.lang.Runtimeexception:…
-
2
votes1
answer343
viewsQ: File reading in the IDE works and at the time it generates the . jar does not work
I have an application that reads a text file that is in the same folder where the application is. When I run the program in netbeans it reads the normal file: But when I Gero the JAR it does not…
-
0
votes3
answers446
viewsA: Sum of component numbers
Breaks the value in substrings and goes back to int. if(nb > 500 ) { String aux = Integer.toString(i); //TRANSFORMA O NUMERO EM STRING int un = Integer.parseInt(aux.substring(0, 1)); //PEGA O…
javaanswered Pedro Afonso 119 -
0
votes1
answer672
viewsQ: Change the color of the Jtable header
How do I change the header color JTable using the Nimbus Look And Fell? I tried to use: JTableHeader header = jTable2.getTableHeader(); header.setBackground(java.awt.Color.yellow); But it didn’t…
-
2
votes2
answers319
viewsA: What is considered when ordering a varchar field? Being filled in by numbers
He considers as an alphabetical reading, taking the first value, as "1" and "2" comes before "3" he considers them first, since it is a text field and it does not matter the total value but…