Most voted "java" questions
Use this tag when the question refers to some resource, information, or problem relating exclusively to the Java programming language. Java is a class-based, statically typed, reflective, and execution environment (JRE) language. Java programs are compiled to bytecode and run on a virtual machine (JVM), allowing a "write Once, run Anywhere" philosophy (WORA).
Learn more…14,468 questions
Sort by count of
-
6
votes1
answer368
viewsDesign Observer applied to events
I’m studying design standards and I’m trying to apply a real situation to them. And one example I did was on the event stage: In this scenario every event has participants to register. So, for that,…
-
6
votes1
answer1432
viewsIs it possible to know how many customers are connected to Serversocket?
How do I see how many customers are connected to my ServerSocket java?
-
6
votes2
answers642
viewsNfe - private and public key reading applet
I need to develop a system to issue an electronic invoice. My big problem is that this system needs to meet the A3 certificate (card) and as far as I’ve been reading with php it is not yet possible…
-
6
votes1
answer14394
viewsDecrypt db.crypt files
I wonder if there is any way to decrypt files with the extension db.crypt in general, on the Android platform and there is some API that does this work?
-
6
votes1
answer4491
viewsMake URL open in the same Activity
I’m creating a WebView for Android. When I load the App, the imported page works perfectly, but when I click on some link page, that same link opens in another browser. I wonder how I can make all…
-
6
votes1
answer55
viewsMethod resolution
in the example below public static void foo(Integer i) { System.out.println("foo(Integer)"); } public static void foo(short i) { System.out.println("foo(short)"); } public static void foo(long i) {…
-
6
votes1
answer1924
viewsMessage "Could not reserve enough space for Object heap" in JVM
So I wanted to know the limitation for memory allocation to the JVM depending on the operating system and processor architecture. If, as you set it, you lower the maximum value of the perm-size to a…
-
6
votes3
answers6396
viewsHow to display an image on the screen
I’m doubtful to display an image on the screen on android. example. to call a sound use the following code: Button button1; MediaPlyer mp; button1 = (Button)findViewById(R.id.button1);…
-
6
votes1
answer1021
viewsJava Graphics Drawing Tool
I wonder if you have any tools with Ireport that I can use to make a graphic similar to this image. I’ve used Jfreechart, but I couldn’t make it look like this! The bar values have to be at the…
javaasked 9 years, 9 months ago Renato Romão 191 -
6
votes2
answers4369
viewsFunction that returns screen resolution
I need a Java function that returns the resolution of my Android device.
-
6
votes1
answer732
viewsDifference between scheduleAtFixedRate and Schedule in the Scheduledexecutorservice class
What’s the difference between scheduleAtFixedRate and schedule? I am developing an Android app that I want to be 50 minutes late before starting an action and repeat that action in the next 50…
-
6
votes2
answers280
viewsPass two parameters to a function that accepts only one parameter
I’ve been making a code to generate a pdf from the framework Itext in Java. I came across the following situation, I needed to define a phrase as negrito and sublinhado. After searching Google, I…
-
6
votes2
answers1478
viewsEntitymanager with JTA multiple connections
I’m having a bit of an unusual problem, but I’m looking for a solution. I have a scenario where I have several databases (postgresql) allocated in several clients, all databases have the same…
-
6
votes1
answer1253
viewsThread Control in Java
I have a multi thread Java system that uses the class ThreadGroup which is deprecated. With my current implementation I can’t "kill" a thread in lock either. How to implement efficient code for…
-
6
votes2
answers14324
viewsCheck whether the string is null or empty
How do I check if my variable is empty or null? // Inserção Nome = tf_Nome.getText().toString(); Tipo = tf_Tipo.getText().toString(); Estoque = Integer.valueOf(tf_Estoque.getText().toString());…
-
6
votes1
answer640
viewsHow do the <p:editor> of the first faces escape the special characters typed by the user before saving them?
I am using the primefaces component. My problem is that it is recording the accents that the user type into the text without doing the proper Escaping HTML. There’s a way to change this so he knows…
-
6
votes4
answers1206
viewsJava Class Scanner Loop Error
When using the nextLine() method instead of next() in the code below, code interactions are skipped and some fields are empty. import java.util.Scanner; public class turma { public static void main…
-
6
votes1
answer2824
viewsHow to measure area and diameter of flat uneven scanned image (not 3D) using java?
I’m from the health area and never took a course in Programming Language, but for some reasons I will need to make a software to help in my research. I need to measure the total area and also area/3…
-
6
votes1
answer1276
viewsMulti Thread Socket Server - Java Server and C++ Client
I have to develop a Mini Server Socket Multi Thread (college work) in Java and need to make a Client in C, for example, can be in any language, but I chose these two. How do I send the Client values…
-
6
votes2
answers959
viewsHow to compare the value of a Hashmap<key, value> with a variable?
I have a HashMap aluno<Integer, Float>, where the key Integer will be the student’s registration number, and the amount Float will be the student’s grade. I got the grade average using the…
-
6
votes1
answer895
viewsDuplicate records with Onetomany relationship
I have a map as follows: public class ClasseA { public ClasseA(){ listaClasseB = new ArrayList<ClasseB>; } @OneToMany(mappedBy = "xxxx", fetch = FetchType.LAZY, cascade = CascadeType.ALL,…
-
6
votes1
answer694
viewsDivision of the EJB Project
I have an EJB project, to implement the system the project needs to be divided into 3. The Database on a machine The User Interface on another host And the EJB(Services) in another But the whole…
-
6
votes1
answer505
viewsHow to increase the text size of a Webview?
My app reads RSS feeds. but what bothers me is the letter that is small, I want to leave a little bigger that is visually "right" in a standard way. It’s like this: But I want to make it bigger to…
-
6
votes1
answer2639
viewsCall PL/SQL precedent with object collection
Consider the following types: CREATE TYPE meu_tipo AS OBJECT ( meu_id NUMBER(6), meu_nome VARCHAR2(200) ); CREATE TYPE meu_tipo_tabela AS TABLE OF meu_tipo; And the following package: create or…
-
6
votes1
answer1928
viewsHow to connect DVR camera in Java?
I’m having a question, I’ve searched the internet but I can’t find anything consistent: how to connect with a DVR camera (not IP camera) using Java? I already use Opencv and can connect on IP…
-
6
votes1
answer361
viewsHow to Run Javascript in Java 8’s Nashorn Engine Programmatically
From Java 8 we have a new engine for Javascript execution, this is Nashorn. Which Java SE platform classes are involved in engine discovery and script execution? How to run Javascript through the…
-
6
votes2
answers7676
viewsHow to add SQL Server dependency to Maven?
I’m trying to add dependency on SQL Server in my POM but gives Missing Artifact. <dependency> <groupId>com.microsoft.sqlserver</groupId>…
-
6
votes1
answer2269
viewsWhat is the difference between setSize and setBounds?
What is the difference in Java Swing between methods setSize and setBounds?
-
6
votes1
answer545
viewsGenericdao - Is that correct?
I’m implementing a simple GenericDAO as below, but I feel like I’m doing the wrong thing, it works but I feel like there’s something wrong anyway, could help me? I created an interface like this:…
-
6
votes2
answers935
viewsJavafx Time Mask or Timepicker
I have a TextField where I enter with the hour, but I always have to type the :. How can I put a mask on this Textfield or else if it’s simpler TimePicker?…
-
6
votes1
answer319
viewsHow to have multiple addresses in one class of person?
If a person has more than one address. The code below is correct? public class Pessoa implements Serializable { private static final long serialVersionUID = 1L; private int codigo; private String…
-
6
votes3
answers12748
viewsGenerate random numbers in an Array from 10 to 50
Since I can generate an array of random numbers with a limit, they should be numbers from 10 to 50. To generate random numbers from 0 to 50 I use: Random random = new Random(); int array[] = new…
-
6
votes1
answer1333
viewsChange validation behavior in Primefaces components
I have 2 generic templates for crud. The commandButton Template search CRUD.XHTML (Code 2) is with the following logic: (When opening the page, all input fields are disabled, when you click the…
-
6
votes2
answers619
viewsHow to capture the pressing of a key with the program running in the background
The code I have so far is this: public static void main(String[] args) { SystemTray tray = SystemTray.getSystemTray(); Image image = new BufferedImage(10, 10, 10); String tooltip = "Oi amiguinho";…
javaasked 9 years, 2 months ago Lucas Caresia 2,663 -
6
votes2
answers2960
viewsError log in Java application
We developers when we code, we have a way to track the process of running software through the output of the IDE, but when the software goes into production and we no longer have the development…
-
6
votes1
answer4386
viewsnetbeans change java jdk
I upgraded my java, and removed the previous version, now on startup the netbeans gets a message that did not find version 1.7 and asks if I want to use the version default. Does anyone know where I…
-
6
votes4
answers2280
viewsString Manipulation - split()
Is there any way to give a split() in a string and on the same line take the position I want? For example: String nome = "Dan Lucio Prada"; String sobrenome = nome.split(" "); //aqui quero pegar só…
-
6
votes1
answer391
viewsDisplay of Latin characters in a String
How do I display Latin characters as content from a web page? This content to be displayed is written in java, which should code it correctly and return a Stringwith the values to be written to the…
-
6
votes3
answers2268
viewsSite within App
I have a classified site, I need to create an Android app from my site, I do not program in Java, You can create an app where within it is displayed the site in mobile? Type an iframe of the site…
-
6
votes3
answers10606
viewsConvert object to String?
What is the best way to convert an object to a type variable int? Or there is no such conversion? Example: if (teste == JOptionPane.OK_OPTION) { int linha = tblPessoa.getSelectedRow(); // Aqui o…
-
6
votes3
answers504
viewsBD for distribution together with java application
Good evening guys, I have a small JAVA application in which some data is entered. I would like to distribute it with an DBMS that does not require download and installation/configuration. I have…
-
6
votes2
answers930
viewsWhat does "serialVersionUID" mean?
Eclipse suggested I put this snippet of code: /** * */ private static final long serialVersionUID = 1L; I’d like to know what his purpose is... If anyone can explain it to me, I’d be grateful.…
-
6
votes1
answer2745
viewsHow to convert a PDF file to TXT in Java?
Is there any java way to convert a PDF extension file to TXT extension?
javaasked 9 years ago Tiago Ferezin 1,567 -
6
votes1
answer622
viewsHow to take refresh from the full page when using the Fileupload component of the first faces
I’m using the component FileUpload of the first faces in the mode="simple" and it’s run normal. But when I click the save button on a certain folder, it refreshes the whole page. There’s a way to…
-
6
votes2
answers2638
viewsSearch words cannot find the word
Guys, I’m trying to make a game of word hunting in java, but I can’t find the word, someone can help? Follows the code: import java.io.BufferedReader; import java.io.FileReader; import…
javaasked 9 years, 7 months ago Maikon Michael 73 -
6
votes5
answers1382
viewsNo return on method?
I have a method where its function is to read a file and store the value written in the file in a variable and return the variable,: public String addItemCreative(File f){ String line = null; try{…
-
6
votes2
answers123
viewsHow to separate libraries in an app suite?
I have a suite of web applications composed of several applications, each one specialized in a company area, such as property management, contract management, HR management, works management, among…
-
6
votes1
answer100
viewsUnexecuted entry
I’m a beginner in development and I’m doing a job for college, but in my case of Register Creation line 147 (cadastro[1][codigo] = entrada.nextLine();) that would receive the customer name data is…
-
6
votes2
answers2292
viewsHow to save a list of elements with Shared Preferences
I am creating a contact list and would like to save this list with Sharedpreferences. Example: public class MeusContatos extends Activity implements OnClickListener { int pos=0; public static final…
-
6
votes3
answers10207
viewsWhat is the JBOSS?
I’m reading a book about distributed applications and he occasionally references Jboss. I would like to know what it consists of and its usefulness?