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
-
5
votes2
answers1293
viewsHow to create Jbutton in "square" format?
It is possible to create JButton in a "square" format, without the rounded corners when they are already in the JFrame? Does anyone have an example? I don’t use any specific laf, but the netbeans…
-
5
votes1
answer90
viewsWhat’s wrong with my chained list?
I implemented a chained list but when I enter 2 items, I remove the last one and add it again, for some reason it says that the value is null. public class ListaDinamica<T> { private class…
-
5
votes1
answer230
viewsSpring and EJB have the same features?
Spring and EJB have the same features? If not, you can use both in the same application?
-
5
votes1
answer3655
viewsHow to Encrypt with AES Algorithm using 128-192-256 keys in Java
I need to do an encryption with the AES algorithm by testing the runtime according to key sizes (128-192-256), but I’m not able to find how to switch the key size to be generated by the system,…
-
5
votes1
answer201
viewsError when deploying lambda EJB project using glassfish 4
I have in my project two java files First.java. package br.com.bom; import javax.ejb.Stateless; @Stateless public class Primeiro { } Second java. package br.com.bom; import javax.ejb.Stateless;…
-
5
votes1
answer1244
viewsAndroid app in the background
I’m working on the open source project Linphone,when the application is closed is not working in the background, so if someone makes a call to me in the meantime I am not notified, how can I treat…
-
5
votes1
answer201
views -
5
votes1
answer150
viewsDoubt how to make Insert in this model
I am developing an application that has the need to have a natural person and a legal, I would like help to know how would be the insert of this model If I want to register a natural person I must…
-
5
votes3
answers3518
viewsHow to solve the problem "The main method was not found" in a Java class?
I created this Arraylist and at the moment of execution the following message appears: Error: Main method not found in class Declaracaoarray.Declaracao_array; set the main method to: public Static…
-
5
votes1
answer1147
viewsHow to query in Manytomany tables?
I have two tables/entities in the database with the following attributes: Car (code, plate, color) Acessorio (code, description). public Carro buscarCarroComAcessorio(Long codigo) { return (Carro)…
-
5
votes1
answer851
viewsJtable getValueAt() behaving differently than expected
I have a Jframe where there’s a Jtable that displays some data. When the user selects some records and clicks on a certain button, those selected records should be deleted. When only one record is…
-
5
votes1
answer147
viewsGson to Java - Map
I need to pass these values from a json file to a java class file, the Json file is of this type: { "id":1, "name":"Gold", "description":"Shiny!", "spriteId":1, "consumable":true, "effectsId":[1] },…
-
5
votes1
answer1241
viewsCustomize android webView error page
Please have a webview on my android app, how can I customize if the user doesn’t have internet ? Thank you Code of the current webcview : WebView wv=(WebView) findViewById(R.id.webView); WebSettings…
-
5
votes2
answers200
viewsGrab thumbnail of videos (Windows)
I Googled several terms of how to get the thumbnail of the videos but only found how to "generate" the thumbnail of a frame of the video using the Xuggler, but I’m making mistakes. The mistake I’m…
javaasked 9 years ago Wilson Tamarozzi 382 -
5
votes1
answer153
viewsMap opens before picking up the GPS position
I’m studying programming for Andriod and I came across a feature that I just don’t know anything, which is the order of execution of the duties! please , someone could give a light? I explain, in my…
-
5
votes2
answers527
viewsIs there a difference between the visibility of a view.GONE or false?
I would like to know which of these implementations is the correct one? tlb.setVisibility(View.GONE); or tlb.setVisibility(false); What’s the difference between them?…
-
5
votes2
answers987
viewsHow to put a Popup that asks permission to use GPS?
Guys, I’m programming in Java (with Android Studio) and this code to get the position of GPS, which works very well! Now I’m trying to learn how request authorization from the user to use GPS, but…
-
5
votes2
answers446
viewsIn the POO when to use Re-turn?
I have a question related to POO, when should I use the return in a method?! Since when I pass an object to the method and modifications are made to it, I do not need to Return, example below:…
-
5
votes1
answer1435
viewsWhat’s the Youtube show for?
If I don’t declare that constant (serialVersionUID) in a class that implements the interface Serializable, I get a Warning. But what is this constant for anyway? Its value interferes with the…
-
5
votes1
answer342
viewsJava, convert floating point hexadecimal value
I am developing an application that receives data from a GPS board, the data is received by bluetooth in hexadecimal, the latitude and longitude values are floating points of 64 bits, which follows…
-
5
votes1
answer7203
viewsHow do I resolve the "No appenders could be found for logger" warning?
I am trying to configure Log4j in my project with JSF. I followed all the steps of a tutorial I found on Youtube. However, the following message is being sent: log4j:WARN No appenders could be found…
-
5
votes1
answer468
viewsProblem with JSF 2 redirection
In a JSF project the pages are organized like this: admin/pages admin/main admin/template. My web.xml is like this: <?xml version="1.0" encoding="UTF-8"?> <web-app…
-
5
votes1
answer486
viewsjavax.persistence.Persistenceexception (no security manager: RMI class Loader disabled)
I created a policy file that gives permission for my machine to run both the client and the server, I also passed the ports to them. Inside the server I prompt RMI Security (since if I remove it the…
-
5
votes2
answers1986
viewsDiagonal matrix in java
First, I would like to inform you that I am new here on the site, and if by chance my question was left without information or badly organized please speak. I was trying to solve that question: I…
-
5
votes1
answer889
viewsHow to send data from one Vector to another Activity?
I’m still a beginner, and I have the following question: I’m inserting text from a EditText in a array, and I want to receive it in another. I am doing the following: String[] pedidos = new…
-
5
votes3
answers1598
viewsHibernate vs Eclipselink
Both persistence frameworks implement JPA. 1 - There is a difference between the two? 2 - Which is the best in performance? 3 - As the two implement the same specification, after developing a…
-
5
votes1
answer109
viewsHave the functional features of Java 8 made any Pattern design obsolete?
It is said that functional programming makes certain design patterns (thinking of the Gof) unnecessary. There’s even a presentation showing it somewhere (I’m not looking now because I’m on cell…
-
5
votes1
answer124
viewsUpdate Table in Postgresql
I have the following question in Java: how can I pass to SQL that it should capture the "date and time" of the computer and update the User Table in Postgresql? Follows code: public class…
-
5
votes2
answers1407
viewsHow to Transform Time String to an Entire?
Example, I get a String with the "16:20" time of day. The day is 1440 minutes long. How to know what interval from zero to 1440 is this time? In an integer value(integer).
-
5
votes2
answers1590
viewsHow to save files to a server via Java?
I need to save a file to a server using Java. In my case, I need to save a file json. I can save a file normally on my computer, but how do I save directly to a remote server? Below is an example…
-
5
votes2
answers6153
viewsHow can I not allow the user to type numbers and only text in Java?
I am creating a program about registration in which the user has to put name, password, email, etc. But in the fields such as name I want the user can only put text instead of numbers,and that if he…
-
5
votes1
answer11610
viewsError running program: Unsupported major.minor version 52.0
While running my program I am getting this error: Exception in thread "main" java.lang.UnsupportedClassVersionError: TestaContador : Unsupported major.minor version 52.0 at…
-
5
votes1
answer317
viewsError while uploading an Angularjs+Vraptor file
I have a system where I can upload files through an Angular library (ng-file-upload), but if the file is larger than 3MB when I try to upload I have the following errors: GRAVE: Servlet.service()…
-
5
votes2
answers1706
viewsCapture user name logged into machine via Web Application
There are two applications, one in Java and one in ASP and both manage to integrate with Active Directory without me typing user and network password. The application made using ASP, automatically…
-
5
votes1
answer2138
viewsSpring MVC x Spring MVC Boot
What is the difference between Spring MVC x Spring MVC Boot? Are they the same thing? Is there any advantage in using the second? Thank you
-
5
votes2
answers1164
viewsJava: Understand working Wait() notify() notifyAll()
I’m studying Threads Java and its resources and I came across a question. I have the following classes in my program: public class Main { public static void main(String[] args) { ThreadB b = new…
-
5
votes2
answers4257
viewsSpring Boot x Spring MVC
Spring Boot is the same thing as Spring MVC? In practice no longer use Spring MVC (or, should not use) and only Spring Boot?
-
5
votes1
answer537
viewsHow to open a password protected Word document?
I can normally open a file .docx in Word using the desktop.open java, but there is a case where I need to open the document that is password protected and Word opens asking for it. Is there any way…
-
5
votes1
answer3875
viewsHow do I save an image to the database in Sqlite?
How do I save an image to Sqlite? I ask you to be as specific as possible because I don’t have much experience. In case I want to include a table row to save the image. import br.gestaoBd.Login;…
-
5
votes3
answers1022
viewsYou’re a builder, right?
I’d like to understand why this class has two builders and why one of them has everything in it this and not separated as in the other. This changes something? Normal builder: public…
-
5
votes1
answer1324
viewsjava.lang.Classnotfoundexception error: "Caused by: java.lang.Classnotfoundexception: com.fasterxml.Jackson.core.type.Typereference
I am developing a Java, FX, Hibernate application and using log4j2 for my logs. When I run the application through the IDE (Eclipse) everything works normally, but when creating the . application…
-
5
votes1
answer87
viewsJava int[] arraylist
I’m creating a list from a array using the method Arrays.asList. Now I want to remove the first element, but Java accuses: Exception in thread "main" java.lang.Unsupportedoperationexception…
-
5
votes2
answers4626
viewsHow to compare the content of two vectors?
public class VetorTurma { public static void main(String[] args) { int pontuacao = 0,nota,c; String nome; Scanner sc = new Scanner(System.in); double gabaritoVetor[] = new double[10]; double…
-
5
votes1
answer204
viewsWhat is it, Beacon?
What is Beacon? How can I implemented using Android? Can be implemented in . NET or only in java? Have some simple example?
-
5
votes3
answers1764
viewsHow to create a static method using Kotlin?
In JAVA when we want to create a static method, we use static. Look at: public static String getDragonGlass(){ return String.valueOf("All the dragon glasses."); } And in the Kotlin, how best to…
-
5
votes3
answers185
viewsAnimation in images
Is there any way to make an image rotate by, say, 90 degrees when clicked on? I want that when clicking on the image, it takes a turn, like a clock pointer for example.
-
5
votes2
answers5377
viewsFormatting date in java
I need to format a date that comes for example: 20161109103000 for 2016-11-09 10:30:00. I’ve tried to use SimpleDateFormat, DateTimeFormatter and I couldn’t format the date.…
-
5
votes1
answer121
viewsPerformance difference from for simple and for iterator
I have a list of customers and on a certain screen the user can do a search and edit the clients of the list that is quite extensive, comparing these two examples which would be the best to work?…
-
5
votes1
answer246
viewsSpring MVC getJdbcTemplate Insert in Oracle return column value
I have a project in Spring MVC, I’m using the getJdbcTemplate to make Insert’s. Only I do not insert the key Primary in Oracle from a sequence and need that value to re-enter another table where…
-
5
votes1
answer1207
viewsHow to access a specific http header?
I have a Rest API in Java, which makes use of JWT to authenticate users and generate tokens to access their resources. I have an application in Angularjs, which should consume these resources, but I…