Questions tagged as 'java'

1
answer

Open .js file when MediaQuery is larger than 1024px

At the end of index.php (responsive layout) you have a call to < script type='text/javascript' src='desk.js'>< /script> It turns out that this JS will only act with MediaQuery greater than 1024px. I ask: Is it possible to m...
asked by 06.07.2017 / 07:00
1
answer

Take a network file in java

I was able to open a file and put it in a Jlabel on the machine where I'm developing. But when I put the application on the network the machine that is on the network, it does not find the file. Is it possible to get the file from a networked ma...
asked by 05.07.2017 / 22:49
1
answer

How to put an integer into a label

I'm trying to put a sort of punctuation counter on an ex Jlabel: you hit an issue the score goes to 1, you miss and nothing happens with the punctuation. I tried to do it this way: private void confirmarActionPerformed(java.awt.event.Act...
asked by 06.07.2017 / 15:01
2
answers

Working with JSON for request and response Java

I need to consume a WS with rest that is almost complete, only 2 things to finish: - mount the request JSON and manipulate the response. JSON Here is an example of the template I need to submit in the request: { "sendSmsRequest": {...
asked by 07.07.2017 / 16:43
1
answer

Filter passes before the login servlet

Good evening, I have a question, I do not even know if I need to post the code to solve it. The filter is being called before the login servlet, ie the user is never logged in. How do I get the servlet called before? Remembering that I do...
asked by 30.05.2017 / 23:05
1
answer

Thymeleaf error templates in Heroku

I implemented my application in Heroku, just for testing ... Locally everything works fine, but in Heroku after I log in with the credentials I'm directed to the sac/index page, which is correct, but me returns:    "Whitelabel Error Pa...
asked by 30.05.2017 / 22:07
1
answer

Extract the li list with xpath

Hello, I'm developing an application with java + selenium I have the second web element: WebElement results = ( new WebDriverWait( driver, timeout ) ).until( ExpectedConditions.visibilityOfElementLocated( By.id( "local" ) ) ); Where id...
asked by 30.05.2017 / 20:49
1
answer

Java - Add information in XML file with JDom

In this code an xml file is created and an element is inserted: comentarios = new Element("comentarios"); myDocument = new Document(comentarios); comentario = new Element("comentario"); comentario.setAttribute("id", "123"); El...
asked by 19.05.2017 / 05:18
1
answer

How to change the color of the lines of a JTable?

I need the line color to change whenever the cell value equals 0. However, all lines are being painted. View with a simple JTable import javax.swing.JTable; public class View extends javax.swing.JFrame { private EstoqueActionL...
asked by 05.05.2017 / 22:43
1
answer

Display a value with the non-zeroed cents and using Float?

Is there any way to keep cents from being cut with Float? I'm converting a value to be formatted with DecimalFormat so it looks like the cents like this: Float numero = 2564786549.87543771885808f; DecimalFormat df = new DecimalForma...
asked by 09.05.2017 / 15:12