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
votes2
answers1107
viewsUpdate the value obtained in an Edittext
Next, I’m having a problem taking the value in an Edittext and displaying it in a Textview. The value displayed when using a string, is "null", and when using int, is 0. I believe this happens…
-
2
votes1
answer1144
viewsCalling Java class inside Oracle
would like to know if it is possible to call a Java class inside the Oracle database. I was able to install the JVM inside the Oracle server already, but I cannot compile the Java class. Does anyone…
-
2
votes1
answer148
views -
2
votes1
answer1110
viewsHow does Webservice SOAP/Rest work with JAX-WS?
I spent a whole day studying and finally managed to perform authentication with Webservice SOAP using JAX-WS, using Eclipse generated client. When adding the password and password to the SOAP…
-
2
votes1
answer349
viewsLayout management issues with Miglayout
I’m having trouble managing the layout of a Jframe that is a test. How are you: How I wish it were: import java.awt.Color; import java.awt.GridLayout; import javax.swing.JFrame; import…
-
2
votes1
answer121
viewsSyntax Highlighting with/in the Swing framework
How to make a syntax Highlighting, like what Ides use, but in/with Swing framework, with Java. I intend to use syntax Highlighting in several different keywords. How can I change the color of the…
-
2
votes1
answer2663
viewsSearch method involving Java and SQL Server
How to do a java search by passing an (SQL) attribute as parameter? I decided to type a sketch of Cod: MAIN static private void PesquisarUsuario(Connection con) throws SQLException { int cpf;…
-
2
votes1
answer856
viewsError message in Glassfish
I’m using the Glassfish 3.1.2.2 along with the Netbeans 7.4 and I don’t know where you keep giving this information every time I start the server: INFO: The [admin] user of the 127.0.0.1 host does…
-
2
votes1
answer72
viewsError running Spring Roo
I am trying to install and run Spring Roo. I downloaded it, unzipped it in the opt folder, gave the permissions in the folder and created the links. But when running the command "Roo" a big error…
-
2
votes1
answer479
viewsHow to simulate the Python title function [string.title()] in Java?
In python, the string has a function called title, which makes a text look like a title. Does it have a function like this in Java? If not, how to do it? Example: "Hi, my name is Goku". title()…
-
2
votes1
answer625
viewsCheck encoding of an XML
I need to process a number of XML files. One of the requirements is that the encoding be it UTF-8. Any other kind of enconding must be rejected. That is accepted: <?xml version="1.0"…
-
2
votes0
answers147
viewsSend local files to Google Cloud Storage in Scala
How do I upload a local file to Google Cloud Storage using the Scala language? This file needs to be publicly accessible for download. Post in English…
-
2
votes2
answers1812
viewsWhy compare Enum with an Enum Object
When I was learning Java, I had a Class that had a property like Enum, and, at a certain point, I wondered if what was coming in a Method was equal to a constant of the Enum, something like that:…
-
2
votes4
answers6198
viewsJavac does not compile. java
The error of return is this, when I am already in the folder appears this information: --javac Main.java '--javac' não é reconhecido como um comando interno ou externo, um programa operável ou um…
-
2
votes1
answer819
viewsHow to deploy and run liquibase?
How do I deploy liquibase? and run it? I have java projects and use oracle database. This tool has the possibility to generate from the version file of the state of the database, you can generate in…
-
2
votes2
answers1417
viewsHigher frequency of a string
I have a text where I am treating several things. Now I need to get the 3 words that are most repeated in the entire text. How can I do this? What is the best solution? I thought about storing in a…
-
2
votes1
answer98
viewsNull Pointer with Location Manager
I have the following code which returns NullPointerException on the line: lat = location.getLatitude(); private GoogleMap mMap; private String provider; private LocationManager locationManager;…
-
2
votes2
answers949
viewsInsert the json format into mysql and recover in Java
I have the following string in format json: { "ADT":"0", "CHD":"0", "INF":"0" } I need to do the Insert in a table on mysql database and retrieve it in Java. I’m using VARCHAR(50) and it looks like…
-
2
votes1
answer792
views -
2
votes1
answer859
viewsHow do I add a matrix to an edge of the graph?
My graph is implemented as an adjacency matrix. The graph is acyclic. I intend to create a method that takes two nodes and creates an edge from one to the other with an Nxm matrix. What’s missing or…
-
2
votes1
answer133
viewsHow to make getHeight() not return 0 before the Draw method?
I have a problem where I need to make a ball appear in the middle of the screen getHeight()/2, the real problem is in the function init() where the value of getHeight() return me 0, which should…
-
2
votes1
answer75
viewsException occcured while finding Account via ID
gave this error when trying to run a class error Sef.module13.activity.Accountdaoexception: Exception occcured while finding Account via ID that’s the class package sef.module13.activity; //…
-
2
votes1
answer855
viewsCompare Local time Joda Time
I have a comparison that checks whether the current time is after the time set. LocalTime horaConfig = new LocalTime(6, 00, 00); LocalTime horaAtual = new LocalTime(20, 00, 00);…
-
2
votes1
answer289
viewsExclusion involving Java and SQL
The program I’m doing requires a deletion of users from the bank! In the code I determine: Menu: static private void Excluir(Connection con) throws SQLException { String cpf; Scanner s = new…
-
2
votes1
answer63
viewsClass relationship by collections in JPA2
In a bean that has a Onetomany connection, with others, through a Hashmap that annotations should be used?. @Entity class Rodada{ public HashMap<Pergunta,Resposta> perguntas;…
-
2
votes2
answers115
viewsRemoving object from Arraylist, object is still there
A friend and I are creating a game in which the character captures coins and earns points. I created an Arraylist of coins and when the character rectangle intersects with the rectangle of the coin…
-
2
votes2
answers4619
viewsTic-tac-toe - Implement logic
Good people, my final work of the semester is to assemble a game of old in java, I did all the look of it, but the problem comes here: I need to make every mouse click it changes the icon of the…
javaasked 10 years, 5 months ago Gabriel Ozzy 545 -
2
votes1
answer983
viewsHow to measure time complexity of sorting algorithms?
Given a sort algorithm, for example burble Sort, how to measure its run time? For example, let’s say that the input of the vector or list has a size of 1000 elements, what is the time measured in…
-
2
votes1
answer847
viewsPut WS Restful Project into Production
I’m a beginner in Java and these . jar, . War, etc businesses are news to me. I did my first Restful Webservice project and added 2 *.jars, Gson and JDBC.postgres. I want to put into production (on…
-
2
votes1
answer1720
viewsLogin screen on Android
I emulated a local server by XAMPP and started trying to develop a login screen for an Android application. It is working perfectly, but only when I log in through localhost(using my local IP…
-
2
votes1
answer3128
viewsIdentify Android version by some method
Is there any method to identify the user’s Android version as soon as it enters the application? It will be useful for the application to run or not animations between screen transitions, if the…
-
2
votes0
answers316
viewsWeb Java Layout for Desktop
I’m analyzing a way to draw more pleasant and close screen web. I searched the internet and I know that with Javafx I can draw rich and beautiful screens, I wonder if there is any more framework or…
-
2
votes1
answer402
viewsStackoverflowerror exception occurring in @Manytomany relationship with JPA
I’m having a problem in an entity relationship @Manytomany. When I try to make a simple query in the entity that contains @Manytomany a stackoverflow occurs. My rule is simple: My…
-
2
votes2
answers7595
viewsList directory and subdirectory files with listFiles
Today I list through the code below the files that are in the directory passed by the parameter, but now I would like to list also the files that are in the subdirectories. I did some searches but I…
-
2
votes3
answers220
viewsHow to build a differentiable for a Generic class?
How would it be possible to build a differentiated constructor for classes that extend a generic class? For example, for the situation below, I would like to create a Generic builder that can…
-
2
votes1
answer144
viewsAndroid - take the splash screen from the back-stack
I’m finishing a college job where an app should present a splash screen and then a login screen. I would like it, as soon as the splash screen was finished, it would go out of history. The structure…
-
2
votes1
answer433
viewsDraw Regular Polygons inscribed in a circle with Canvas in Javafx
Mind you, this is a method I’ve developed to create the vertices of regular polygons inscribed in a radius circumference r @Override public float calcularRaio(float lado, int numeroLados) {//…
-
2
votes1
answer149
viewsPrevent animation from repeating when changing the orientation of the device
I’m working on a screen that contains an animation that is repeated every time the screen is rotated. I searched but found no precise information of what I need to do so the animation does not…
-
2
votes2
answers1597
viewsRemove JS file via JS
I have a site that has the fixed side menu and the other part is loaded the pages. For each page of the site I made a js file. For example: Home.jsp I have the home.js file, Contacts.jsp I have the…
-
2
votes2
answers2199
viewsException in thread "main" java.util.Nosuchelementexception
I have the following java method that reads a text file and creates new points (coordinates on a graph), but I am encountering the error title in reading the file. By following my stackTrace it…
-
2
votes1
answer772
viewsGet system resource within Jar file (getSystemResource)
I developed a project where I need to access some configuration files and some images. Inside the project I have a folder (Resources) in which I have all these resources I need. The problem is this:…
-
2
votes0
answers127
viewsHow to read the specifications of a REST Web Service
Hi, I need to create a project with consists of consuming a REST web service, where consuming this web service I need to generate an XML with its information/specifications, what are its methods,…
-
2
votes2
answers813
viewsCreating a double array (not a multidimensional array)
I need to pass two values of the kind double for a AsyncTask in my application. I tried to define an array using the following code: double latitude = location.getLatitude(); double longitude =…
-
2
votes1
answer1864
viewsMessage "301 Moved Permanently" began to appear suddenly
I have two applications that worked perfectly, however, without changes in the code, no longer work. On one side, an application with a JSP making a call POST and passing two parameters Hidden:…
-
2
votes1
answer133
viewsHow to create (Spawn) multiple rectangles?
I’m creating a little game Jframe where I need to create several rectangles that will be the projectiles/bullets of my character(main/main) then I created the following class: Bullet Class package…
-
2
votes1
answer406
viewsRun Graphviz (dot.exe) through Java application
I am trying to generate a graph from a . dot file using the Graphviz tool. To do so, inside a Java application, I am invoking the command prompt, navigating to the Graphviz installation folder and…
javaasked 10 years, 5 months ago Natanael Ramos 223 -
2
votes1
answer783
viewsHow to put an image in Jcombobox?
When the user selects the option, an image appears on the side.
-
2
votes1
answer420
viewsCreate Java Index by generating HTML file?
I needed to create a reference index with a book passed by parameter (File, BufferedReader). So far I did not get good results, I have only a code that generates a TreeSet with all words of text…
javaasked 10 years, 5 months ago Lone_Dryad 43 -
2
votes2
answers2748
viewsPassing parameter null to a method
It is possible to pass/receive null parameters in Java. In C# I know it is possible using ? in kind. public DateTime Teste(DateTime? exemplo){...} In this case the example I know can come null, in…
-
2
votes1
answer443
viewsPermissions and antivirus issues to run the application
I created an application in Java and generated an executable . JAR, which works perfectly, after this I used the Launch4j which transforms my . JAR into . EXE and then I used Installcreator to…