Questions tagged as 'java'

1
answer

Android - How to call a method from another class from onCreate ()?

I'm pretty new to Android. So if you can explain the logic behind the problem I would appreciate it. This would help me understand the problem and see how I could solve it if it happens again. In activity one I have a method that is executed...
asked by 11.01.2018 / 11:53
2
answers

Error converting String to Numbers in Java

In my last post ( do / while double-repeat the expression ) had an overlapping input problem using the Scanner class, and according to the links placed in the response, we can not use nextLine () after nextInt (). Now I'm doing another algori...
asked by 18.01.2018 / 00:19
1
answer

Posting a JSon object to Webservice via AJAX

I'm trying to send an object in JSon format to my Java Webservice by AJAX, but I was not successful, I already tested wrong formats, which are not JSon's, as "string", and the database reports error properly, and therefore should report that the...
asked by 17.01.2018 / 22:54
1
answer

How do I remove a specific item from a double-chained list?

Given the class No, being: public class No<T> { T elemento; No<T> proximo; No<T> anterior; public No(T elemento, No<T> anterior, No<T> proximo) { this.elemento = elemento; this.proximo = proximo; thi...
asked by 06.12.2017 / 17:45
1
answer

Java test cases

I'm trying to run a test on the banking system that I've done, I'm using netbeans for this. I need to perform test in the option to withdraw and deposit, in the case what I have done so far only the error in everything, but I did not understa...
asked by 14.12.2017 / 13:14
1
answer

Java WebView how to use

How do I use webview when I use: public void site(){ WebView browser = new WebView(); WebEngine webEngine = browser.getEngine(); webEngine.load("http://mySite.com"); } I have the error: Exception in thread "AWT-Even...
asked by 07.12.2017 / 21:07
1
answer

Fragment not being loaded inside FrameLayout

I created a NavigationView with 3 items, when clicking on one of them, a specific fragment should be loaded inside the FrameLayout, but this is not happening. I believe the error is in the XML, because when I select a menu item the onNavigationI...
asked by 07.12.2017 / 19:28
1
answer

One method to retrieve information from another method

Hello, I'd like some help. I'm redoing the caelum object-oriented java handbook and there was a question I'd like some help with. In the handbook asks to create a simple system of a bank. Going straight to the subject, was created a class acc...
asked by 07.12.2017 / 18:40
2
answers

What encoding to use when it comes to accent?

There is so much encoding ... I've looked a lot in Google and can not tell when to use each of these here ISO-8859-1 UTF-8 LATIN1 cp... I've tried UTF-8 because I've always thought that if it was an accent it would be UTF-8, but it did not w...
asked by 12.12.2017 / 00:12
2
answers

How to make a method that compares values from two objects?

Given the following algorithm in Java that computes the IMC: class Pessoa { String nome; double peso, altura; double calculaIMC () { return peso / (altura * altura); } String avaliaIMC () { double imc = ca...
asked by 21.12.2017 / 08:19