Questions tagged as 'java'

1
answer

How are the functions of the standard libraries of different programming languages implemented?

How are standard libraries of different programming languages implemented? For example, stdlib.h , or Java.Swing , how the System.out.prinln() function is implemented for example.     
asked by 08.07.2014 / 09:30
2
answers

JTextArea gets append but does not display text

I'm having trouble using a JTextArea. I need every time something happens on my system, an info is added in real time. However, it does not appear anything. I've tried to use setText() and append() , but neither worked. However,...
asked by 11.07.2014 / 18:28
1
answer

The code generated by the GUI builder of netbeans affects application performance?

Netbeans has a user interface creation tool using swing a>, which greatly facilitates the development of desktop applications, however, the tool seems to create numerous lines of code even for something simple many times. Example: Thi...
asked by 28.01.2016 / 10:46
2
answers

How to do an implicit conversion (inheritance) without losing information

Hello, I'm doing a project for college where I have to implement 3 classes. These classes inherit from each other as in the model below: public class AssinanteFree { protected int id; public int getId() { return id; } public void...
asked by 28.06.2018 / 13:28
1
answer

Is there something like the C # namespaces in Java?

I noticed the size of the command to put a message on the screen in Java, I wonder if it has any way to decrease? As in C # the programmer puts the word using "namespace"; and you can use the "shortened" command. Eg to print the Hello...
asked by 13.08.2018 / 01:04
1
answer

SonarLint, complexity of the "equals ()" method

SonarLint for Eclipse, accuses the error:    Refactor this method to reduce its Cognitive Complexity from 64 to the   15 allowed.       Rewrite this method to reduce your cognitive complexity from 64   for 15 allowed That is, my method h...
asked by 13.08.2018 / 15:13
1
answer

Emphasis on cmd return

Considering a method to list the files of a folder using ProcessBuilder I have the incorrect return of the accented words. Code import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import jav...
asked by 27.11.2016 / 07:36
1
answer

Enable GPS within the application

Currently to check if GPS is enabled use the following code: public boolean checkSetting(){ LocationManager manager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); return manager.isProviderEnabled(LocationManager.GPS_PR...
asked by 21.04.2017 / 15:47
1
answer

Effective internet connection test

I have an application in which I test a connection before consulting a webservice , to display a message to a user who does not have an internet connection. I use a method like this: public static boolean isConnected(Context context) { Co...
asked by 09.04.2017 / 01:36
1
answer

JTable getValueAt () behaving differently than expected

I have a JFrame where there is a JTable that displays some data. When the user selects some records and clicks a certain button, these selected records must be deleted. When only one record is selected, everything works perfectly, but problem...
asked by 19.11.2016 / 02:22