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
-
0
votes0
answers209
viewsJava Spring MVC error 400 - Search for 2 fields
You guys, blz?! Next, I’m finalizing a project to complete a chair in college and I’m getting a very strange mistake. I’ve already checked with another classmate, but we can’t identify. I need to…
-
0
votes2
answers88
viewsRun Service with a Broadcastreceiver
I need to run a Service through a BroadcastReceiver, but error occurs: android.os.NetworkOnMainThreadException. To "deviate" from the error, I’m using the code below, but I want to do it the right…
-
0
votes0
answers281
viewsError while searching the database using Java, Hibernate and Spring. Use of Beans and Autowired
I’m trying to make a search in my program, but the mistakes appear: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cursoSpringDataApplication':…
-
0
votes1
answer953
viewsHow to compare String to String received in a . jsp?
I have an html page and it sends a form with POST method, I take the data like this: String email = request.getParameter("user"); When I compare the email string to another string containing the…
-
0
votes0
answers640
viewsHow to use super in java?
I know the basics of super, but for example : If I have a class mae Person with attributes name, age and sex, and a class daughter Student with attributes course, enrollment and period, and a class…
-
0
votes1
answer59
views -
0
votes2
answers2211
viewsHow to change the title of an Activity?
I have an Activity and I need to change its title programmatically, I found a way but it doesn’t work for me, check it out: protected void onCreate(Bundle savedInstanceState) {…
-
0
votes0
answers96
viewsJava how to create a custom command line
Hello folks wanted to know if you have how to customize the command line... basically create a custom line on the console I have a code that creates a terminal capable of supporting colors (Windows…
-
0
votes2
answers1479
viewsHow to delete a specific Child in Firebase?
I want to delete only 1st Child (L7jrj6dtqwrmzsc4zvt) from Firebase through an option in an Android app. I searched several places and could not find. I only found the option to delete the whole…
-
0
votes1
answer234
viewsHow to open a Jframe passed as parameter?
My idea is to open this window passed as parameter without it losing any attribute, for example, I have the class : public class Teste { JFrame janela = new JFrame; public…
-
0
votes1
answer152
viewsCalling a method via datatable lines
Given my datatable below: <p:dataTable id="tabela" var="linha" value="#{naturemb.lista}" paginator="true" rows="10" rendered="#{not empty naturemb.lista}" > <p:column…
-
0
votes1
answer59
viewsImageview appears in only a quarter of the screen
I have the following function in my android app: public void createBall() { layout = new RelativeLayout(this); // Random choose color of ball int[] color={R.drawable.vermelho, R.drawable.azul,…
-
0
votes2
answers53
viewsI must stop the application when I run a test
I currently have my application in production and need to create some tests (Junit). My question is whether I need to stop the application or can run the direct test. Has anyone passed or knows…
javaasked 6 years, 6 months ago Maicon Queiroz 47 -
0
votes1
answer58
viewsDagger Nullpointerexception 3rd class which depends on 2nd class
In a project that has the Activity, Presenter and a Model, the Activity has the Presenter and the Presenter has a Model. When I do @Inject in the Presenter to instantiate the Model it is never…
-
0
votes1
answer155
viewsfindViewById(2131230729) what are these numbers?
I’m analyzing a class from an Android app project, I’m new and didn’t understand these numbers within the findViewById(2131230729), within the parentheses was to have R.id."layout" as I do through…
-
0
votes1
answer87
viewsWebapp Doubt - Netbeans Javafx
I am testing to create a webapp in . jar for desktop even, using the NETBEANS Webview Sample Tool - Javafx. The code is as shown below. I’m just looking for a way to remove the address field and the…
-
0
votes0
answers87
viewsextract data from the list
I made a few attempts, but I’m still picking up follows what I added in the code. How can I make this limitation within the code that results in the closure below? I lacked logic of how to implement…
-
0
votes2
answers1217
viewsUpdate Jtable using Defaulttablemodel
I understand that the use of Defaulttablemodel is almost abhorrent, however, I used this model and now I have no time to change to a Tablemodel (which I haven’t learned to use yet), is there any way…
-
0
votes0
answers59
views"java.lang.Nullpointerexception" in JSF Hibernate application
My web application uses JSF/Hibernate , but when I run a search method in the BD it returns "java.lang.Nullpointerexception " . What will be the cause of the error ? /* * To change this license…
-
0
votes0
answers55
viewsError in String.replace Java
I’m having a hard time getting the String.replace("á","a") In my case I type Canadá and I want out houseboat, but in the output appears instead of a square, as if there were an invalid character.…
-
0
votes0
answers250
viewsSending a CSV file to an ftp server
My application makes an order registration, already creating a file CSV and throwing that file into FTP, the registered application creates the CSV, but when to upload to ftp error(I think), follows…
-
0
votes1
answer60
viewsError while listing database data - JPA2 and Hibernate / JSF
Console error in eclipse mar 27, 2018 2:05:24 PM com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException GRAVE: Error Rendering View[/Fornecedor.xhtml] javax.el.ELException:…
-
0
votes0
answers91
viewsAbout updating only one jsp page html tag
I have a Japplet application it has a button that when clicking it takes the data typed in the textfield and plays in a url that is an index.jsp and there is a getParameter that takes this field.…
-
0
votes0
answers255
viewsJava + postegre connection problem in Heroku
Trying to connect java to the Heroku database (postgre), I have checked the url several times and there are no errors. I am not using Hibernate. By pgadmin I can enter it into the database normally.…
-
0
votes1
answer498
viewsHow to test my web service done under spring boot using a specific profile?
I am developing a Restful web service using Spring Boot and I would like to know how to run unit tests with requests directed to web services without first having to raise the server manually. I…
-
0
votes1
answer312
viewsConnections Pool opens connections but does not close after!
I am facing some problems with my postgresql connection pool with java, in which it is called by my Daos methods quietly, but does not close after the method runs, And that really gets in the way of…
-
0
votes1
answer672
viewsHow to compare user-typed strings to Strings already saved in a . txt
I’m working with file manipulation and I’m not able to compare what the user types with the password and login saved in the person’s registration file! I can’t get a specific position inside the…
-
0
votes1
answer900
viewsRead a CSV file
I was able to import the csv inside the cell, however when trying to read the file so that the application does the information inside csv it happens an error: java.io.Filenotfoundexception:…
-
0
votes1
answer213
viewsError loading gallery or camera image
I’m having the following error while loading image gallery or smartphone camera. And I can’t find where this error because it only happens on some smartphone models. java.lang.Runtimeexception:…
-
0
votes1
answer54
viewsChange visibility
How do I change the visibility of a layout that is in another Active? I want to do this by clicking on an image.. I know how to use the method onClick. only lack the imagination of how to change…
-
0
votes1
answer210
viewsHow to put a layout for each tab bar action
The code shows an application with 2 tabs: List and register, I want to put a listview in one and a form in the other, but how do I make each one have its own xml? package…
-
0
votes0
answers85
viewsHow to access a method of an Arraylist in another frame?
Classe Pessoa : public class Pessoa { private String nome; private int idade; public Pessoa(String nome, int idade) { this.nome = nome; this.idade = idade; } public String getNome() { return nome; }…
-
0
votes1
answer112
viewsSelectevent autocomplete returns null object
I’m using the autocomplete and when I enter a field, it alone fills two other fields with the method handleSelect(SelectEvent event). But these two objects of these fields are getting null when…
-
0
votes3
answers3185
viewsHow to connect my android application to an external database
I have a site with some tables in the mysql database. The site is already connected in the database. I have an application in Android Studio and would like to connect the application with the…
-
0
votes1
answer63
viewsDoubt with scanner
I wanted a help with a program that would ask the person what city they’re from. If she typed a city other than the programmed one, the program would say that the person could not proceed (I intend…
-
0
votes1
answer603
viewsPassing JS variable to Managedbean
I have a variable in js, and I need to send it to my Managedbean, which is the most correct way to do this?
-
0
votes1
answer51
viewsPrint negative line DPP-450 Datecs Escpos
I’m starting a project on this printer (DPP-450), and I came across a problem that I’m unable to solve: I need to print a negative line, black background and blank writing. In the manual this "GS B"…
-
0
votes0
answers116
viewsError Null Object
I’m developing an app delivery (with client version and Adm) in which the administrator version changes the status of orders through a spinner, after which the client app receives a status update.…
-
0
votes1
answer72
viewsVery large array - Android
Which ones problems I could face in the manipulation of arrays many a great? When I say arrays I mean at least 25, each containing +of 1000 index. Performance: Would my application’s performance be…
-
0
votes1
answer543
viewsTake only equal elements in a matrix
I have a matrix for example: 1 4 7 1 3 4 6 7 1 2 3 4 5 6 I have to see the repeating numbers in ALL lines, in the example, the numbers should be the result: 1 and 4. For it is they who repeat in all…
-
0
votes0
answers24
viewsMysql workbrench
Does not continue, for 99%. How do I continue the installation ?…
-
0
votes1
answer6616
viewsHow to resolve java.lang.Indexoutofboundsexception: Index: 25, Size: 25
I am developing an online questionnaire in JSP, where the user selects the radio of each question to be validated. Example: a questionnaire of 25 questions, if the user reaches 25 and clicks the…
-
0
votes1
answer347
viewsGrab images from the drawable folder by name
I would like to know how to take an image id from the drawable folder and use it in an Imageview. I am trying to do this within a Listview String nomeImgFilme = filme.getImagem(); int imgID =…
-
0
votes1
answer68
viewsJsf pages from entities class net Beans Foreign key
When I send jsf pages from entities class by net Beans, it generates crud automatically from the database even in primefaces if I prefer, but when I put some table that has foreign key relation, at…
javaasked 8 years, 3 months ago Fernando josé 437 -
0
votes2
answers407
viewsSort objects in json file (Java)
I have the following JSON file: {"idAluno":1,"nomeAluno":"Teste","listaDeTurmas":[1,2,3,4]} {"idAluno":4,"nomeAluno":"Teste","listaDeTurmas":[1,2,3,4]}…
-
0
votes1
answer1462
viewsDynamically change the image of an imageView (Android Studio)?
I have a two-button View image, go back and forth. In a gallery of 5 photos I would like to keep changing the image so that one button forward an image and the other back. I know how to do just to…
-
0
votes1
answer103
viewsHow to create browser tabs in Android Studio
Hello! , I’m creating a browser for Android using Android Studio I’m trying to create a feature that has in all browser that are the multiple tabs like Google Chrome, but I’m out of luck and all my…
-
0
votes2
answers919
viewsJSON Infiito when using GET @Manytomany
I have two classes, of which you have a @Manytomany relationship generating the third table described in the code below: Card package br.com.rpgnext.deck.critical.model; import…
-
0
votes2
answers684
viewsClick on button inside an iframe
I’m using Selenium to test a page but the button I need to click is inside an iframe that is inside a frame. this.wait.until(ExpectedConditions.elementToBeClickable(By.id("corpo"))); WebElement…
-
0
votes0
answers385
viewsDisplay login user profile data
Good guys to creating a panel where have my profile section for the Administrator who is online can see your profile information. However I am still having problems creating the profile page, I have…