Posts by Renan Gomes • 19,011 points
435 posts
-
2
votes2
answers71
viewsA: How to perform text distribution on a line
Use the property text-align - MDN. p { padding: 4px 0; width: 100% } .direita { text-align: right } .esquerda{ text-align: left } .centralizado { text-align:center } .justificado { text-align:…
css3answered Renan Gomes 19,011 -
1
votes4
answers1380
viewsA: Warning box after click div
There are several plugins to facilitate the creation of a Modal window. An example using jBox: $(function(){ new jBox('Modal', { // Tipo de componente width: 400, // Largura height: 200, // Altura…
-
3
votes2
answers804
viewsA: How to block all "radios" of a form when clicking a button?
Just set/change the value disabled of the element to true. document.getElementById("foo").disabled = true; sample code: var radios = document.getElementsByName('dog');…
-
6
votes1
answer2569
viewsA: How to limit the amount of 'checkbox' selected?
$(function(){ var MAX_SELECT = 3; // Máximo de 'input' selecionados $('input.limited').on('change', function(){ if( $(this).siblings(':checked').length >= MAX_SELECT ){ this.checked = false; }…
-
1
votes3
answers11171
viewsA: Add jquery "loading" effect
One solution is you create a div containing the image or message by loading and leaving it with visibility:hidden or display:none. In that link Stackoverflow-en there is an explanation about the two…
-
10
votes4
answers19850
viewsA: How to get the key pressed?
All you had to do was use String.fromCharCode() to get the key pressed (instead of the number). var pressed = document.getElementById('pressed'); function keyPressed(evt){ evt = evt || window.event;…
javascriptanswered Renan Gomes 19,011 -
1
votes2
answers394
viewsA: Change image size and box with %, not working
At first you are making wrong use of the positioning properties, I say this based on the result you are seeking. Internal elements need to adjust to the div father proclinica_projetos, it would need…
-
1
votes3
answers367
viewsA: Stop Menu scroll in certain resolution
It is better to manipulate classes rather than elements directly.You can start this menu with a class responsible for keeping it fixed at the top and then use Javascript (Jquery) only to check…
-
3
votes2
answers2204
viewsA: How to make SVG image fit the size of a DIV?
In your specific case, if you look at the code of svg the height and width are being set: <svg width="678pt" height="1200pt" ... Simply change this height or remove it (working only with CSS),…
-
1
votes2
answers71
viewsA: How to get multiple Jsonobject with the same key?
The class I use to manipulate JSON has no method iterator, still follows an alternative using loop : JSONArray array = new JSONObject(json).getJSONArray("participants"); int lenght = array.length();…
-
2
votes3
answers14756
viewsA: Centralize one div within another 100% div
The easiest and simplest way is by using margin: 0 auto. It’s enough that your div parent has a defined width. .a { height: 200px; width: 100% } .b { width: 80%; margin: 0 auto } /* somente para…
cssanswered Renan Gomes 19,011 -
2
votes1
answer98
viewsA: Tag Audio does not work on Phonegap
Because the tag audio, for now, supports only three file formats: .mp3, .wav and .ogg. There is support for reproduction of .aac also, but only in a MP4 container. On this page you can see some…
-
0
votes2
answers138
viewsA: center form vertically to the center
You just need to change a margin rule on your id #form-contato: #form-contato { color: #58595B; margin: 13% 0 } This will make it have a 13% margin at both the bottom and top. Upshot: current | with…
-
2
votes1
answer816
viewsA: Disable Jquery button in Chrome
I couldn’t reproduce the problem. A slightly better way to accomplish this process you are doing may be as follows: $(function(){ $('#deleteSelecionados').on('click', function(){ var self = $(this),…
-
2
votes1
answer4116
viewsA: How to extract information from an HTML document with Jsoup?
Just pick up all the elements with class postWrapper which is where the content of your interest is, for that there is the method getElementsByClass. Then just iterate the found elements (which is a…
-
2
votes2
answers145
viewsA: I used an array in a method parameter and do not know how to run
A NullPointerException simply because the position 0 of your array is null. The problem starts here: cliente[1] = new Cliente(); // Mas e a posição '0' ?! When the method mostrarClientes run, it…
-
1
votes2
answers537
viewsQ: When should I save my application data to the system registry?
I need to store some information of my application for when the user starts it again to be loaded the data of the last use. At first I thought about using the Windows registry (in this case I’m sure…
javaasked Renan Gomes 19,011 -
5
votes4
answers24849
viewsA: CSS DIV diagonal
Otherwise, in addition to those already presented and explained, also using the property skew but applying the transformation only to two elements (one before and the other after the image), rather…
-
1
votes1
answer399
viewsQ: How to open a packaged executable in the project?
I am running a program as follows: Runtime.getRuntime().exec("C:\\meuprograma.exe"); In which it works normally. But I would like to package the files (the executable and a few more) within my…
-
2
votes2
answers1652
viewsA: 2 different tables from each other
Use selectors to distinguish tables your page has. p { color: red } #p { color: blue } .p { color: green } <p>Selecionado por elemento</p> <p id='p'>Selecionado por ID</p>…
-
2
votes1
answer1582
viewsA: Vertical alignment of icones
This is normal behavior, the width occupied by all <a> is bigger than your div’s #icons. Even if you use the property white-space:nowrap (in #icons) the internal content shall exceed the: In…
-
0
votes2
answers949
viewsA: Insert the json format into mysql and recover in Java
If the JSON have only these three properties, maybe it is better to persist as text. Anyway, Java has an object to work with Blob: Inserting: String jsonString = "{'ADT':'0','CHD':'0','INF':'0'}";…
-
2
votes1
answer500
viewsA: Adapt Tooltip code to an already created jTextField
I think it’s much simpler to create a Tooltip with HTML (instead of JToolTip). Multiple components support HTML, test with one JLabel: myJlabel.setText( "<html><p…
-
2
votes1
answer799
viewsA: Error sending image to Imgur, how to resolve?
When I needed to implement a method for sending images to Imgur (the way you are doing, without authentication) I ended up finding the same code you are using (Example on API v2). I tried to use it…
-
2
votes2
answers1216
viewsA: Make div daughter have same size as fixed parent
The way you’re doing it won’t even work because the property fixed has its positioning calculated relative to the screen. Want the div daughter is fixed (visually) at the top of the div Dad doesn’t…
-
78
votes6
answers24661
viewsQ: What is the difference between declaring variables using Let and var?
Since the word was introduced let in the Ecmascript I have only heard about it, so far I have not seen any practical example and to be honest I do not know very well what is a variable let and how…
-
4
votes2
answers1739
viewsA: How to change the position on the map each time the user clicks a link?
One way is by defining latitude and longitude with attributes data-*. You may have an element <a> with the following marking: <a href='#' data-latitude='-xx.xxx'…
-
3
votes1
answer2447
viewsA: How to create a page with multiple images? One over the other
Using position: You can define the images with absolute position. This way, the positioning of each one will be defined with the properties top, bottom, left and/or right. In this case, it is better…
-
2
votes1
answer290
viewsA: Campo Jtextfield
SimpleDateFormat Documentation and Patterns: Simpledateformat. SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy"); // Valor no textfield. Entrada: 14/01/2015 String text=…
-
11
votes2
answers2053
viewsA: Pass parameter without specifying the type of variable to receive in the function
If you’re wondering what kind of object, work with Object. After all, every Java class is subclass of Object implicitly. To check the type of the object, you can create a method for this: public…
javaanswered Renan Gomes 19,011 -
4
votes2
answers216
viewsA: Leave click on A throughout the LI
Since your <li> has defined width and height, simply define the <a> with display: block occupying 100% width and height: li { width: 250px; height: 35px } a { background: skyblue;…
cssanswered Renan Gomes 19,011 -
21
votes1
answer5560
viewsA: About the boolean attribute Defer and async vs optimization
Using async, if the browser does not support, it ignores the attribute and drops/executes the script normally, or it simply ignores it, not carrying it? It ignores only the attribute, the script is…
-
1
votes2
answers1415
viewsA: How to authenticate a user via HTTP request?
After several attempts I found a solution using Htmlunit even with a documentation somewhat complicated I managed to authenticate a user in a Vbulletin forum. Before sharing the code, I would like…
-
1
votes1
answer473
viewsA: Background-color from Lection does not work
Maybe some other rule is overriding this one because the CSS is correct and working. Try declaring this rule right at the beginning of the CSS file, above any other definition. ::selection…
cssanswered Renan Gomes 19,011 -
5
votes1
answer7551
viewsA: Pick up the selected item in Jcombobox
To get the selected index: int indiceSelecionado = seuComboBox.getSelectedIndex(); Or, to get by item (value/word): String itemSelecionado = seuComboBox.getSelectedItem().toString(); Another way is…
-
48
votes4
answers3512
viewsQ: What do reticence in the parameters of a method mean?
I was looking at some methods of the package classes javax and some of them have signature similar to this: protected void doInBackground(String... params){} What does that mean " ... " ?…
javaasked Renan Gomes 19,011 -
4
votes3
answers2948
viewsA: How to add contiguous numbers from an array?
Before dealing with the sum, I believe your logic is wrong. The statement says that the input will be an undetermined number of values and your loop from 0 to 9. To sum all indexes just loop from 0…
-
2
votes3
answers7855
viewsA: Prevent user from pasting special characters
It may be frustrating for the user not to have the practicality to paste a word into the input. Or you can paste but the text be "cut" in half (index 0 to the first occurrence of an invalid…
-
16
votes1
answer511
viewsQ: What is the technique of hiding components to ensure information?
I missed the name of this technique in which the person responsible for development rather than dealing with the problem simply hides it. Example: I have a button that when clicked causes a DROP…
security-guardasked Renan Gomes 19,011 -
8
votes2
answers5928
viewsA: How to remove the default arrow(from the browser) in the select tag?
In that gist there are several proposals to resolve this bug reported a long time ago. I remember using the property moz-appearance:none a few months ago and have worked, went to create an example…
-
4
votes1
answer873
viewsA: edge on TR not appearing
According to the session 17.6 of the recommendation: Rows, Columns, Row groups, and column groups cannot have Borders (i.e., user Agents must ignore the border properties for those Elements). 17.6.2…
-
5
votes2
answers2115
viewsA: CSS for different browsers
No need to create a CSS for each browser First of all: Define box-sizing:border-box on a universal selector so there are no surprises in the size of the elements. See in this article because to…
-
3
votes3
answers4422
viewsA: How to toggle text between "show / hide" inside a javascript button
Just use innerHTML to read/define your text <button>. $div = document.querySelector('.minha-div'); $button = document.querySelector('.handle-div'); $button.onclick = function(){ this.innerHTML…
javascriptanswered Renan Gomes 19,011 -
5
votes2
answers639
viewsA: How to get all paths of a Jtree?
How can I get all paths of a Jtree including the nodes that have parents other than root? I did some research and the logic to have access to all nodes is quite simple. First, get the root of his…
-
4
votes2
answers1415
viewsQ: How to authenticate a user via HTTP request?
I’m trying to authenticate users in a forum Vbulletin by means of an application desktop using components of the package swing, the code is working but I believe that this is not the best way to do.…
-
3
votes1
answer237
viewsQ: Does the last instruction of a switch need 'break'?
I was watching some tutorials on Youtube and noticed that some programmers leave the last instruction of a block switch without the word break. For example: switch(frutas){ case "abacaxi":…
-
4
votes4
answers19339
viewsA: How to go to a link by clicking on a div without using <a href>
Just pick up the event from click in the element you would like the action to take place. document.querySelector('div').addEventListener('click', () => { window.location = 'http://answall.com' })…
-
4
votes2
answers1659
viewsQ: What is and what is the reserved word "strictfp" for?
I don’t know this keyword, I’ve never seen an example of code in which it was used. Until today I discovered her existence by reading some books about Java, however it was not clear what the utility…
-
5
votes1
answer147
viewsQ: Persisting all data as string is a problem?
Is there any problem in storing all the information of an application like string in the database? Independent of the application, SGDB, the programming language used, etc. I ask more for data…
-
2
votes2
answers6070
viewsA: Convert Jtextfield to integer and save to bd
The method getText returns a String with the value in JTextField, then basically what you need to do is parse that value for an integer. int valor = Integer.parseInt(textField.getText()); It is…