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
answers103
viewsOpen an Activity with onMarkerClick
i want to open a new Activity when clicking on the Marketer, however I click and it is not opening, I did more or less like this: @Override public boolean onMarkerClick (final Marker marker){ if…
-
2
votes1
answer170
viewsHow to keep the screen turned on in later versions of the Kitkat API?
I’m making a APP that keeps the smartphone screen always on, even when the APP is minimized. I’m using a class with extends Service to do this, in onCreate I put the code that keeps the screen…
-
2
votes1
answer104
viewsMapping active and disconnecting users to exceed 3 users
I wonder how I could map the users who connect based on their unique id’s and id session so that when there are more than 3 sessions for that id, the users who connected first are removed from the…
-
2
votes0
answers81
viewsLoading Jtable and processor gets high in process
I’m making a sisteminha and in it has a JTable and I need to loader my data, I’ve been analyzing by task manager that when this table load function is called, it greatly increases the processor…
-
2
votes1
answer365
viewslistview with text image and subtitle
I’m building a sales app where a user will publish their product with: image, price, description and value. I can list the photo all right but I can’t put a title and the other descriptions Here’s…
java android listview android-fragment android-adapterasked 7 years, 10 months ago Felipe Moreira 25 -
2
votes1
answer46
viewsError clicking a button to access website
I tried to make the user click on a certain button, it was directed to a site, in this case google, but it did not work. The app starts normally, but when you click the app button, it stops: This…
-
2
votes1
answer169
viewsDoubt with Jcombobox to insert data at runtime
I’m new to Swing and this is the first Java application I’m actually doing, but I’m having doubts about Jcombobox, because I would like to make a field (Jtextfield) where I put the directory and…
-
2
votes1
answer716
viewsFirebase reference error
I am developing an application in Android Studio and using Firebase as a bank, but after finishing the structure of the project when I went to test it accuses a reference error of Android Strudio…
-
2
votes1
answer477
viewsRead another variable in Activity that is updated in Mainactivity
I have a function that runs every second. This function sends a request for information via socket to a device. This information is received on a AsyncTask that makes the calculations and updates…
-
2
votes1
answer1016
viewsCDI Java - Configuration
I created a simple design containing a Test class and a Testeinterface interface. In the interface test I created any method just to test. In the Test class I only put @Inject Service service; When…
-
2
votes1
answer361
viewsHow to display a parse string in a Textview?
I’m trying to add an image with a description on the server parse. I’ve already been able to add the image description by objectId, but the problem is that I don’t know how to display the text of…
-
2
votes2
answers90
viewsPublic with 2 variables does not return value
I have 3 publics that should return a calculation value for me to present on the Activity screen. The first, volume_agua_mehta(), returns normally, but the second, massa_brita_mehta(), and the…
-
2
votes0
answers901
viewsIs it interesting to learn JSP in 2017?
This semester in college I will attend the course of Software Development for Web and while studying the menu I saw that we will use JSP. What struck me is the fact that the discipline comes…
-
2
votes1
answer145
viewsSpring MVC validation error in nested Entity
You guys all right? I started studying Spring recently by the courses of Algaworks and at the course progress I came across a problem in a project the part that I am developing. I have an Entity…
-
2
votes1
answer82
viewsI can’t open the map in my position
After a lot of research, I still have difficulties with java, I’m new and I’m trying to learn. Please forgive me if I can’t ask a clear question, because I may not even know what I’m talking about,…
-
2
votes2
answers1928
viewsConsume Web Service SGS Banco Central Brasil - Dollar Quotation
I was able to generate the (java) client in Eclipse, available in WSDL https://www3.bcb.gov.br/sgspub/JSP/sgsgeral/FachadaWSSGS.wsdl. The following classes were generated: package…
-
2
votes1
answer382
viewsSort an integer Linkedlist without Sort method?
I want to know a simple method to order a Linkedlist! I’m breaking my head and searching the Internet, but I just find methods that already perform the work that I WOULD LIKE manually perform.…
-
2
votes2
answers224
viewsSetup pointcut AOP Spring
I have the below pointcut setting on Spring 3 <aop:config> <aop:pointcut id="baseDaoPointcut" expression="execution(* br.com.infraestrutura.domain.BaseDao+.*(..))" /> <aop:pointcut…
-
2
votes2
answers2553
viewsError saving Sqlite Data (in such table)
Databasehelper class: public class DatabaseHelper extends SQLiteOpenHelper { private static final String BANCO_DADOS = "MakeRequestApp"; private static int VERSAO = 1; public DatabaseHelper(Context…
-
2
votes1
answer2332
viewsBat to finalize process and close application on desktop
In the company that works we have an application called Socket developed in java to run files in the browser, but I need a bat to kill the process and close the icon of the application and start it…
-
2
votes1
answer145
viewsHow do I display the Floatingactionbutton?
Could you help me? I’m trying to make the Floatingactionbutton appear on my screen but it doesn’t want to appear I don’t know what I do anymore...I’m a long time trying to solve this problem but I…
-
2
votes1
answer159
viewsLoad image after selected item
In my application the user defines a root directory. After defining the root there is the listing of files present in the directory. When the file is selected there is another directory where there…
-
2
votes3
answers876
viewsHow to repeat a minute-to-minute notification
I’m creating a app simple that gets a notification every time I click a button on my layout, everything works perfectly. Now I want this notification to be repeated for example every minute until I…
-
2
votes0
answers545
views@Managedproperty in a Managed Bean class returning null
I am trying to inject a Managed Property in my class, but whenever I try to access it in a method annotated with @PostConstruct it returns me null thus generating an Exception. Follow down my class:…
-
2
votes2
answers2953
viewsMy application does not start in Spring-Tools Suite
I created a Maven project in Spring-Tools Suite when I started this error appears: Exception in thread "main" java.lang.IllegalStateException: Failed to read Class-Path attribute from manifest of…
-
2
votes0
answers1328
viewsError: could not Extract Resultset
I have this method: public List<AvaCriterio> getList(){ List<AvaCriterio> lista = null; try{ Session session = HibernateUtil.getSessionFactory().openSession();…
-
2
votes1
answer1312
viewsPass variable between javafx windows
I’m passing a variable from window "A" to window "B". So far so good. The problem starts when in the "B" window I try to access the variable when the window starts. The value passed does not exist.…
-
2
votes1
answer2870
viewsJDBC - Run a query and use its return as a parameter for another query
I am learning to code in java, alone with the help of tutorials and I am trying to do a procedure where the result of a query will be a clause where for a second consultation. In the example below,…
-
2
votes3
answers404
views -
2
votes2
answers611
viewsHow to delete a particular data from a listview?
The app has two Uttons that when clicked add an item to a listview (bow and sword), but I would like if the item of each button was already present in the listview, the same would be deleted.…
-
2
votes1
answer47
viewsFile Check on Web Server
Next, I have an Android app, this app wants to check the existence of an image on the web to be able to load by Picasso, if the image does not exist in a www.somemacoisa.com/img/imagem5.png I will…
-
2
votes1
answer996
viewsDivision by zero into double = Infinity result
I was learning about error handling in the Java language and did tests with the sample code of the class in question. In a test I added (double) in the final operation to make the result more…
-
2
votes2
answers1162
viewsHow to get back from a Fragment to an Activity?
I created an Activity of type Drawer Navigation and in the icons of this Activity has an action that takes me to a fragment. My problem is that I don’t know how to come back from a fragment to an…
-
2
votes0
answers895
viewsJava Swing program does not open window outside of Netbeans, but is open in processes
My problem is that I made a program in Java in Netbeans and it works normally, but the problem is, when I open it. jar outside the IDE, window is not opened. Here a simple code with the same…
-
2
votes1
answer160
viewsTreat empty field even containing spaces
I made a Celsius temperature converter for Fahrenheit, I’m willing to treat if in JTextField is different from 0, display the temperature in Fahrenheit, but appears 0.0 until empty, with spaces…
-
2
votes3
answers2965
viewsHow to delete data from database in android studio?
I have an application where when the user logs in the first time, I save the Token and NIU, then the next time he accesses the application, he already enters directly into the Webview using that…
-
2
votes0
answers179
viewsString conversion error in Jsonarray - Volley Android method
My application receives a Jsonstring via web service from a C#API as listed below: [{ "LimiteCredito": 123.00, "PessoasFuncionarioId": 16, "Id": 12, "Nome": "Cliente PF A", "DataEdicao":…
-
2
votes2
answers700
viewsHow to disable a java button without removing its color
I have a button that when you click it changes color, but if you click it again nothing should happen. However, I still can’t block this action. I tried that code: private void…
-
2
votes1
answer133
viewsPrintstream does not record accents
Could you help me with a question? My code is not accentuating the text file, even passing the encoding. (I am reading it in notepad) Scanner in = new Scanner(System.in); private String texto;…
-
2
votes1
answer103
viewsHow to apply "If" & "Else" functions to Biginteger?
I have this code in Long functioning normally: public static void main(String args[]){ List<Long> lista = new ArrayList(); for(long a = 1; a <= 100; a++){ if(a%2==0) {} else if (a%3==0){}…
-
2
votes1
answer220
viewsHow to change Graphics2d objects off paintComponent
I wonder how to change the color of a drawRectangle() of Graphics2d java, out of the way @Override paintComponent(). It turns out that this change should be temporary, only when the mouse pointer…
-
2
votes0
answers185
viewsWhy does the jboss server crash and not run with the standalone.bat command?
I am trying to configure Jboss and I have already researched in several places my problem. But I still can’t solve it. I changed the default http port in the file…
-
2
votes1
answer81
viewsPublic Type (VB) for Java
I have a project that runs on Vb and I have to move on to Java, in part I have the structure statements. My question is: What is the best way to do this in Java without loss of performance? The…
-
2
votes1
answer230
viewsCreate a Bufferedimage from an int Array
I have a one-dimensional array that contains the colors of an image, where at each 3-position interval the color of a pixel is represented (R,G,B): int[] cores = {255, 0, 0, 0, 255, 0, 0, 0, 255};…
-
2
votes1
answer164
viewsNotification remains in status bar even after click
I have an application where I receive daily notifications, however by clicking on this notification, it still stays on my bar status. I’m using the class Notificationcompat for the creation of these…
-
2
votes0
answers21
viewsChange Table Location Exported from Primefaces
I am developing a web system using jsf and primefaces and would like to ask a question. I’m using the dataExporter to export a dataTable in PDF.... I am using the method preProcessor to add various…
-
2
votes1
answer285
viewsCreate a folder with a given name
I’m trying to create a folder with a certain name but I don’t know why it always appears bin+name. Example: If secondArg = dot then the folder name becomes bindot. Is it because I’m running in the…
-
2
votes1
answer96
viewsHow to correctly position a piece of the View created in java?
After charging my View, if the user clicks the button then a menu appears in front as shown in the image: The top layer of this menu is a FrameLayout, I’d like to leave you with Gravity RIGHT and…
-
2
votes2
answers871
views"java.lang.Nullpointerexception" error in Java
Good afternoon, I have an error on line 17 of main. I have a "Student" object and another "POO1" object. I have written the following code: Aluno aluno = new Aluno (); Avaliacao poo1 =…
-
2
votes1
answer365
viewsWhat is Optimistic JPA Locking Field
What is and what is the "Optimistic Locking Field" of JPA? I noticed that there is this option for Eclipse Link and Hibernate and this function is enabled when annotating a version attribute within…