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
-
2
votes1
answer596
viewsHow to make the Combobox list bigger than Combo itself?
How can I make visible all the contents of the combobox I have without increasing its size? Today she’s like this: I want her to stay that way: Updating Through one comment, I found the solution at…
-
2
votes3
answers647
viewsGPS location returns only null (0.0.0.0)
I have an application for Android devices, with several addresses. By clicking on any address, I wanted to take the user’s current location and play link google maps…
-
2
votes1
answer1021
viewsHow to perform a date check?
I would like to know how to check whether a user-provided input date is valid or not.
javaasked 10 years ago Pedro Rangel 2,747 -
2
votes3
answers86
viewsSetting a Field for a Proxy
Hello, I’m having a problem: I need to change the value of a Field to a proxy. My proxy works perfectly, but I can’t modify a Field. Whenever I try returns me an Illegalargumentexception saying I…
-
2
votes4
answers6235
viewsInserting image with Jasperreport via parameters
I am learning a little about Jasper/ireport and am having some problems generating a report with an image. I followed some tutorials that I found on the Internet but I’m making a mistake that I’m…
-
2
votes3
answers603
viewsMultithread in web application
I have an app that does some server processing and then delivers it to the client. Something like: http://aplicacao:8080/app/videos/extrair/{id}. Where the "id" is the item reference for processing.…
-
2
votes1
answer1508
viewsJpa with Hibernate implementation does not generate postgresql tables
Good evening to all I am using Jpa with the implementation Hibernate to among other features generate tables, the problem is that from one hour to another the tables stopped being generated, someone…
-
2
votes2
answers588
views -
2
votes1
answer111
viewsProblems installing Activator in windows 8
I am having problems installing typesafe-Activator, when opening Activator.bat the windows command prompt returns me the following message: I installed Java SE Development Kit 8 and the problem…
-
2
votes1
answer685
viewsLinkedlist Recursive Method
I’m having trouble implementing a recursive method for inserting an element at the end of a simply chained list. Below is the Iterative method: public void addLast(Node<E> novoNodo){…
-
2
votes2
answers847
viewsChanging index.jsp dynamically without reloading the page
Within my index.jsp I have a table that in one of its cells and an iframe that displays one of my jsp, and depending on the type of action taken by the user it changes which page is displayed within…
-
2
votes1
answer3610
viewsMonetary mask for Jtextfield
I have a field JTextField which must receive a monetary value from the user. I would like to add a mask to this field so that it format the inserted values as follows: 9.999,99.
-
2
votes2
answers773
viewsProgram for Public IP Capture
I need to implement in my program a method to capture the user’s Public IP... remembering that this IP must be stored, even before the user establishes any kind of connection. When running the…
javaasked 10 years ago user17270 -
2
votes1
answer3184
viewsgetOutputStream() has already been called for this Response
I created two identical error pages for two systems running within the same Tomcat. One of the pages works normally and the other occurs the following error. Within the development and homologation…
-
2
votes2
answers290
viewsRecovering List of Outdated Objects with Hibernate
When I manually insert an object in Mysql via terminal, Hibernate does not recover the list with the updated object, it is always the same as the last query, as if it were taken from some cache. I…
-
2
votes1
answer467
viewsApache Lucene with Tika not returning words with accent
I implemented the library Lucene and Tika of the Apache package and managed to make it work super well for what I want. But I have a problem in words with accent, he can not return results for words…
-
2
votes2
answers1136
viewsHow to read a user-submitted file using Fileinputstream?
I would like the user to send a file . xls to the system and from this would be created a database. The method I have is working, but the parameter that Fileinputstream receives is a String…
-
2
votes2
answers725
viewsOrganization of projects in packages
I am doing a study on Java and would like to learn without using those Ides full of resources that do everything. After several attempts to learn how to use packages by creating them manually, one…
-
2
votes2
answers505
viewsPassing Different Object Types to a Tablemodel
I’m starting to mess with Jtable but I’m having a doubt. I’m seeing this post here on another forum and my question is. In case it passes to the table template a list of book type: private…
-
2
votes1
answer56
views -
2
votes1
answer642
viewsLabel is not displayed
I created a label where it would contain the status of the process of connection with the database, but it does not appear and I have no idea why this happens, already three days that I look at the…
-
2
votes1
answer740
viewsHow to maintain screen orientation?
I would like to know the equivalent code in Java for this command: android:configChanges="orientation" Justification: I’m creating an app with Layout NavigationDrawer, and need that on certain…
-
2
votes1
answer158
viewsStore <Integer,Integer,Arraylist<Integer>> in a collection
What I intend to do is make a data association as follows: (<<Integer>, <Integer>, ArrayList<Integer>) I tried to create a…
-
2
votes1
answer54
viewsDefining the constructor of an Object
Hello, I’m doing exercises on constructors in Java but I’m having a question. I have two classes Main java. public class Main { public static void main(String[] args) { Duck[] d = new Duck[5]; d[0]…
-
2
votes1
answer110
viewsTableview Changelistener - NPE
I have two Tableview (tabela1 and tabela2) side by side. What I need to do is: when selecting an item in tabela1 the corresponding item in the tabela2. So far so good, it was easy, but I need to…
-
2
votes1
answer1794
viewsCapturing events on a button
I’m starting in GUI in Java and wanted to understand how it works to capture events on a button, as for example in the code below: Simplegui1.java import javax.swing.*; import java.awt.event.*;…
-
2
votes2
answers270
viewsModify XML features through Java
I got the following RelativeLayout: <RelativeLayout android:id="@+id/layout_avancado" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#FF0000"…
-
2
votes1
answer2885
viewsJava 8 - Collecting elements from a list
Good morning. I would like to collect specific elements from a list. I could do the Java 7 style, but I’m curious to know how I would do in the Java 8 style. For example: [[1, 2, 3], [1, 2, 3], [4,…
-
2
votes1
answer755
viewsImproved Hibernate Performance
I am developing an application in Swing using Hibernate, but I still do not know all the tricks that the tool has and the development used this providing me a beautiful knowledge, but I came across…
-
2
votes1
answer431
viewsProblem with large size JSON on android
I am receiving a JSON file from a Webservice, this file comes with the approximate size of 5.7M, ai ai quando eu converter seu conteúdo para Jsonarray usando a biblioteca Gson, ele apresenta me o…
-
2
votes1
answer365
viewsCollection Namedquery as Parameter
I am using the Namedquery of JPA, to create a DTO. And in my Query I have as condition one IN and as a parameter of IN has values with white spaces in the middle. (Ex: 9292 929). and these values…
-
2
votes3
answers3512
viewsHow to decrease the quality of an image on android?
I have a list of objects that have an array of images that are somewhat "heavy", at the beginning of the application I have a custom listview that displays an image (icone) of each object, I would…
-
2
votes2
answers6415
viewsHow to pass object to another view in JSF?
What better way to pass an object to another view in JSF? I have two pages a query and another with the data to edit a particular object, the query page has a list of objects and each object has the…
-
2
votes1
answer121
viewsLook and Feel is not updated on all subcomponents
I am facing a problem with the look and Feel that I found a little strange, when running the project by the IDE all components are rendered according to the skin I selected, but when I use the JAR,…
-
2
votes1
answer270
viewsI can’t get the artifacts into Maven
I have little experience with Java programming and I’m having difficulties to include the libraries by Maven, and I don’t know if it’s really necessary to create a local Maven repository on my…
-
2
votes1
answer2941
viewsHow to do custom query with JPA+Hibernate
Hello, I would like to know an elegant way to make a custom consultation using JPA. Basically I want to run the query and that it return me an object list, but usually it will be a query with N…
-
2
votes1
answer1118
viewsConvert . raw file to . mp3 file or other audio format
I have an app that makes audio recordings and stores them on a server. I need these files to be converted from the . raw extension to any audio format, preferably the extension. mp3, to be…
-
2
votes1
answer785
viewsCreate a shortcut through the Navigator
Is it possible to create a shortcut through the browser? However, if it is with Javascript, Java, or anything that makes it possible. I need to create a shortcut on the user’s desktop through the…
-
2
votes1
answer315
viewsCollection Map<k,v> Methods
Doubts about the methods replace : compute : computeIfAbsent : computeIfPresent :forEach(briefly all who make use of the function or biFuntion within the input parameter) The replace is it really…
-
2
votes1
answer227
viewsWhen I run the client, the server shuts down, why?
Once I run a Client the Server connection terminates. The while block of the run() method of the Attendant Class does not run. I did a test and the attribute running is true. I can’t understand what…
-
2
votes1
answer966
viewsHelp with Java codemount from ArrayList (search, insert String)
Good evening, I have to develop a code, but I’m having some doubts, follow the code below: public class Aluno { String nome; int mat; Aluno(String nome, int mat) { this.nome = nome; this.mat = mat;…
-
2
votes1
answer167
viewsSpinner in Popup
I have a screen where it has a Gridview and a ImageButton. Well, by clicking on that ImageButton open a PopUp containing two spinner and a ImageButton. Those spinners are populated through a web…
-
2
votes3
answers1459
viewsParse Complex of JSON
I am trying to parse a JSON, using GSON, but there is a complex part, because I don’t know the name of Keys, so I don’t know what name I should use in the variables for GSON to parse. I researched…
-
2
votes1
answer105
viewsHow do you implement a "Preprocessor" Annotation?
I learned that Annotations in Java are just a way to inject metainformation into the code. However, I have seen that frameworks and some libraries have Annotations that "magically" generate code or…
-
2
votes2
answers348
viewsConvert JSON to UTF-8 on Android
I have a JSON Array and when it is displayed in a ListView on Android, appears with special characters: JSON generated by php: [{"id":"1","titulo":"X-Burg","descricao":"Hambúrguer,...","preco":"R$…
-
2
votes1
answer692
viewsjFrame frozen/locked when opening in a jTable
The idea is to click on the row of the table that is a jFrame1 and open another jFrame2 with the search of the information of the person based on RE, but when I click on it the code works but opens…
-
2
votes2
answers292
viewsLeader and Java Recursion Led Logic
I have a relatively simple problem to solve, but I’m not succeeding because of a logical deficiency. My problem is this:: I have a hierarchy of leaders and leaders. For example: Lider 1 Lider 1.1…
-
2
votes2
answers71
viewsHow to get multiple Jsonobject with the same key?
Basically, I have this JSON:…
-
2
votes1
answer64
viewsRequestmapping to a large URL
Wanted to know how I make one @RequestMapping for a large URL. In case I wanted to map the word authenticate.…
-
2
votes2
answers3719
viewsCalculate Distances Api Google Maps v3 Automatically in a Loop
I would like to calculate the distance between two points using the Google Maps V3 api automatically without using an interface, and send them to java for further processing. The coordinates are in…