Posts by Hugo Machado • 866 points
43 posts
-
1
votes0
answers204
viewsQ: java.lang.Noclassdeffounderror: gnu/io/Serialporteventlistener communication with Rduíno
I’m trying to make a java communication with an Afghani but I’m having a problem when I invoke a Class that implements the SerialPortEventListener on my controller. Controllers This Java class is…
-
0
votes1
answer118
viewsQ: Query with two summations for the same column
It is possible to make a query in which in the same query two sums are executed on the same column? Here’s what I got: Total sum of sales select month(emitido_date) as mes, ifnull(sum((det.preco *…
-
4
votes2
answers1837
viewsQ: Group column sum by quarter
I would like to group the sum of one column per quarter, that is every three months. I have the following query which groups from month to month: select month(data) as mes, year(data) as ano,…
-
4
votes2
answers715
viewsQ: Add the 5 highest values to an array
I have the following method: public static void topFiveSales(int idEmpresa) { List < Entidade > allList = Entidade.findByEmpresa(idEmpresa); float totalVendasByEntidade; Float[] totais = new…
-
4
votes1
answer394
viewsQ: window.open() does not load the page
I am trying to open a link in a new window/tab but when it opens it does not load. Controller: public static Result loadCreateArtigo(){ return ok(request().host()+request().path()); } Javascript:…
-
1
votes0
answers211
viewsQ: Autocomplete with id and name search
How can I make an autocomplete with search in two columns of the database? I’ve looked at several examples, and I’ve seen one that uses a kind of grid, it’s like $("#seletor").combogrid(...). I’ve…
-
1
votes3
answers1809
viewsQ: Assign received value via ajax to a variable
I have the following function: var idArtigo = $(".codigo", this).text(); myJSRoutes.controllers.ArtigoDocumentoController.getArtigoByDebitoTipo(parseInt(idArtigo)).ajax({ success: function (data) {…
-
0
votes1
answer4600
viewsQ: How to leave the first Option disabled and selected?
How can I start a selectbox of type Select2 with the first option selected as disabled? HTML: <div class="form-group"> <select name="tipoOperacao" id="tipoOperacao" class="selectTipo2"…
-
3
votes2
answers1379
viewsQ: Mark/deselect all dynamically created checkboxes
I’m creating checkboxes from the comic book. I have another one that defines whether all the other checkboxes are checked or not. When I run the first time it works well, but the second time it…
-
1
votes2
answers2436
viewsQ: Pass object array via javascript to the controller
How can I pass a javascript object array to the controller? JQUERY var array = []; var $linhas = $("#vendaTabela tbody > tr"); $linhas.each(function () { var x = { id: $(".codigo",this).text(),…
-
0
votes0
answers352
viewsQ: Change values from BD in a table
I’m having problems with the data I’m going to retrieve from the database, this when I change it in my table. HTML <table class="table table-striped table-bordered" id="vendaTabela"…
-
0
votes0
answers212
viewsQ: Autocomplete in a table cell
I’m having trouble adjusting this example of autocomplete to my table. I intend to put the autocomplete in the designation cell. What happens is the following: HTML TABLE <table class="table…
-
1
votes1
answer1168
viewsQ: Fill table with BD data
I have a problem adding an article designation through the code. I have the following: HTML <table class="table table-striped table-bordered" id="vendaTabela" width="100%" > <thead>…
-
4
votes2
answers4875
viewsQ: Create Editable Table
I would like to create a table where your cells can be edited but meet certain requirements. What I have is this: HTML <table class="table table-striped table-bordered" id="vendaTabela"…
-
1
votes1
answer1113
viewsQ: Filter table data through checkbox
I have the following checkboxes: <div class="row smart-form"> <section class="col col-1.5"> <label class="toggle"> <input type="checkbox" name="checkbox-toggle" rel="Natureza"…
-
0
votes2
answers787
viewsQ: Receive id from an autocomplete option
I have the following autocomplete defined in HTML HTML <label class="input"> <input type="text" list="list" id="entidade" placeholder="Cliente" onblur="dadosCliente ( )"> <datalist…
-
0
votes1
answer725
viewsQ: Delete Generated Table and recreate again with other data
I have this table that will be generated with values of checkboxes that I select. HTML: <table class="table table-hover" id="table"> <thead> <tr></tr> </thead>…
-
1
votes2
answers568
viewsQ: Javascript-enabled checkbox for controller
I have a group of checkboxes that are generated from the BD, therefore their id will be different. In my case 3 checkboxes are generated: HTML: <input type="checkbox" id="[email protected]()"…
-
1
votes2
answers628
viewsQ: Use validation function in different HTML fields
I have the following javascript function for NIF validation: //VALIDAÇÃO NIF validaContribuinte = function(){ var contribuinte = $('#nif').val(); var temErro=0; if ( contribuinte.substr(0,1) != '1'…
-
1
votes0
answers83
viewsQ: Set attribute as foreign key ebean intellij
I have the following class: @Entity public class exemplo extends Model { @Id private Integer id_nome; private String Designacao_PT; private String Nota_PT; public exemplo(Integer id_nome,String…
-
5
votes2
answers639
viewsQ: How to get all paths of a Jtree?
How can I get all the paths of a JTree including the nodes which have parents other than root? root exemplo1 exemplo1.1 exemplo2 exemplo2.1 If I do something like that: for(int i = 0; i<…
-
0
votes0
answers68
viewsQ: Access to the checkbox of each Ode from a Jtree
How can I access the checkbox of each Ode of a JTree? TreePath[] checkedPaths = checkTreeManager.getSelectionModel().getSelectionPaths(); The previous code returns me all the selected paths. When I…
-
0
votes0
answers257
viewsQ: Print selected nodes of a Jtree
I got this Jtree: I have this code that returns to me all the nodes of JTree: public void print() { recurse((TreeNode) jTree2.getModel().getRoot()); } public void recurse(TreeNode theNode) {…
-
2
votes2
answers2363
viewsQ: Close all open jframes when opening a new one
How can I close all jframes opened in my project when I run an action that opens another jframe? I have a login system and when necessary, I invoke another frame to define a password. After setting…
-
0
votes1
answer300
viewsQ: Handling components of a container
I added a frame with several components to one container. In another class I add to jPanel the data from container. In this class, is there any way I can get access to the components of this…
-
1
votes1
answer119
viewsQ: Return names of selected items from a checkboxTree
How can I check which items are selected from a checkboxTree ? I have already searched and I know that this code returns the last selected: DefaultMutableTreeNode node = (DefaultMutableTreeNode)…
-
2
votes1
answer158
viewsQ: Store <Integer,Integer,Arraylist<Integer>> in a collection
What I intend to do is make a data association as follows: (<<Integer>, <Integer>, ArrayList<Integer>) I tried to create a…
-
1
votes1
answer1595
viewsQ: Browse Hashmap<Integer, Hashmap<Integer, Arraylist<Integer>>
I got the following HashMap: HashMap<Integer,HashMap<Integer,ArrayList<Integer>>> hm = new HashMap<>(); When I do this: Set<Integer> keys = hm.keySet(); for(int i :…
-
6
votes0
answers320
viewsQ: Add checkbox to a Jtree
I’ve looked around for plenty of examples JTreeIt’s checkboxes but it all seems very complex. Does anyone know a simple way, if there is one, to add to a JTree that I dragged to my frame, a checkbox…
-
1
votes1
answer331
viewsQ: Insert component without using setBounds
I’m using a free design in my project and dragging to my jFrame the components I want. However, I needed to use a jComboBox with autocomplete and guided by this site. Now I wanted to use the class…
-
0
votes0
answers185
viewsQ: Adapt jComboBox Code with Autocomplete
Option 1: How can I adapt this code to my project? I created the Autocompletation class and then put it in my constructor: AutoCompletion.enable(yourComboBox); I dragged my combobox in the design…
-
2
votes1
answer37
viewsQ: How to apply a setNull(index,Types.Blob)?
How can I enter null in the database if an image is not loaded? FileInputStream cabecalho = null; conn.setAutoCommit(false); File fileLogotipo = new File(imagemCabecalho); //imagemCabecalho = path…
-
2
votes2
answers1315
viewsQ: Convert Empty string to integer to insert into database
How can I convert an empty text field (Jtextfield for example) to an integer, and then insert it into the database? I have fields in the database defined as int, but when the user does not fill in a…
-
4
votes1
answer1778
viewsQ: Change text and background color Tooltip
How do I change the background and text color of a Tooltip? I already did a search and found here a chunk of code but I can’t change it. Colors always stay the default Netbeans. Any suggestions? I…
-
1
votes1
answer500
viewsQ: Adapt Tooltip code to an already created jTextField
I found this code that works well for the button: public class CustomJToolTipTest { private JFrame frame; public CustomJToolTipTest() { initComponents(); } public static void main(String[] args) {…
-
2
votes1
answer1459
viewsQ: Place icon inside jLabel on jTextField
How to change the date insertion mode in my jTextField? Here’s what I got: I want to insert this icon that is in jLabel inside my jTextField. Is this possible? Upgrade: import java.awt.*; import…
-
1
votes1
answer253
viewsQ: Autocomplete in jTextfield - adapt class
I was able to find here a code for autocomplete in a jTextfield. As I am new to programming, I have tried to adapt this code to use in Jtextfields of other classes I have but I haven’t been able to.…
-
2
votes1
answer596
viewsQ: How to make the Combobox list bigger than Combo itself?
How can I make visible all the contents of the combobox I have without increasing its size? Today she’s like this: I want her to stay that way: Updating Through one comment, I found the solution at…
-
3
votes1
answer612
viewsQ: How to put a Jlabel above the buttons on a Jdialog?
I’d like to put a label on a Jdialog, but above the existing buttons. How can I do that? All components stay online for me: private void…
-
1
votes1
answer101
viewsQ: How to prevent moving the cursor on a jFormattedTextfield with a mask?
I have a field formatted as follows: '### ### ###' When I click on the field that contains that mask sometimes the cursor gets me in the middle or where I click. Example: '##|# ### ###' Is there any…
-
0
votes0
answers53
viewsQ: Insert data into the DB and then change tab
How can I skip to tab after entering data into my database? private void botaoAvancarTab1ActionPerformed(java.awt.event.ActionEvent evt) { String inserirArtigo = ""; String nome = txtNome.getText();…
-
2
votes2
answers375
viewsQ: How to insert a jTabbedPane into a jPanel of another class
How can I add a Jtabbedpane of one class to a jPanel of another class? Possible? In the 'Confempresa' class I created a container and added Jtabbedpane which is called 'jTabConfEmpresa'. public…
javaasked Hugo Machado 866 -
0
votes1
answer54
viewsQ: Insert NIB into database
What type of data is indicated to receive the NIB (Bank Identification Number) in a database? The NIB consists of 21 digits. I have tried but the following error appears:…
javaasked Hugo Machado 866