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
answer713
viewsHow to pass information from a JSP page to a Servlet
I need to pass information from a String variable that is on a JSP page to a Servlet. For example: String path = "C: test.jpg"; How do I get this information from Servlet?
-
2
votes2
answers7155
viewsProblem with Spring "No Qualifying bean of type found for dependency"
Hello, I’m learning a little bit about Spring and I’m having a problem that I can’t get around in any way. I’ve been looking for solutions to this mistake for a long time, but I couldn’t find…
-
2
votes2
answers2225
viewsWhat is and how does a Static block work in Java?
Studying Java I came across the following code: static { System.out.println("bloco estático inicializado"); } Then I ended up calling the method main and the block was executed. How does this…
javaasked 8 years, 2 months ago user53564 -
2
votes0
answers63
viewsAre classes nestled in Java like closures?
I have heard that nested classes have closurelike behavior. This is correct?
javaasked 8 years, 2 months ago user53564 -
2
votes0
answers157
viewsJPA + Eclipselink - Lazy Loading with closed Entitymanager
I am using Eclipselink as JPA preview in a Java SE project. I have correctly configured Weaving to allow Lazy Loading. Unlike Hibernate (which launches Lazyinitializationexception), Eclipselink…
-
2
votes1
answer93
viewsProblems with database connection
I’m developing a test program for integration with webservice. The webservice in itself was developed in the Eclipse. It is a simple service of registration and login of users. When I run the…
-
2
votes3
answers664
viewsRequest within a defined time interval
My application should update a list of data coming from the server every 5 minutes. Using Retrofit for Request HTTP, what’s the best way to do that?
-
2
votes0
answers409
viewsError saving data to Sqlite database
create table works, but when you set the code to save, the application compiles but does not save. Which can be? SQLiteDatabase winlife; EditText edt_meta; EditText edt_tempo; EditText…
-
2
votes1
answer47
viewsNullpointerexception when trying to obtain Java compiler instance
Next, I’m trying to get an instance of the Java compiler, using the following code: JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); if (compiler == null) { System.out.println("No…
-
2
votes0
answers492
viewsBeanfactory not initialized or already closed - call 'refresh' before accessing Beans via the Applicationcontext
I have this error at the time of running my application: 05-Oct-2016 21:18:25.586 SEVERE [localhost-startStop-26] org.apache.catalina.core.StandardContext.listenerStop Exception sending context…
-
2
votes1
answer66
viewsHow to import a . sql file to an android database?
I have a file. sql that contains multiple Inserts and I needed my application to read that file and make those Inserts into a table that I have created. Is there any way ?
-
2
votes2
answers469
viewsWord break
I’m trying to make a line break in a Array, but I am not succeeding in trying to execute the split(), summarizing, I want to make a table of 10 rows with 2 columns that acquire the values of list…
-
2
votes1
answer1079
viewsSave File with Extension
I would like to recover a file of the type blob, and to add the extension, without the user having to type this extension when recovering. The way it is, I’m saving and also recovering, but…
-
2
votes1
answer202
viewsp:selectOneMenu no list
I’m in the struggle trying to popular a selectOneMenu with data from a Enum, but when I gave up and put the static data with f:selectItem I realized that still the field is empty. Even with value…
-
2
votes0
answers214
viewsHow to display data dynamically in Jinternalframe?
I am making a little betting software and I am completely lost in being able to allocate data dynamically in my interface so that for each entry in the database a structure with a JPanel which will…
-
2
votes1
answer235
viewsRequest with Volley Webservice does not recognize json
I am trying to make a POST request with Volley Android, but my Webservice does not recognize the json file that is sent as parameter. With the Google Chrome Postman plugin Webservice consumes…
-
2
votes1
answer133
viewsHow to close a Serversocketchannel?
I have the following code: Selector socketSelector = SelectorProvider.provider().openSelector(); ServerSocketChannel serverChannel = ServerSocketChannel.open();…
-
2
votes2
answers1618
viewsPassing parameter using the " String[] args" declared in main
I’ve been searching the Oracle documentation, examples of copies of files, with their attributes in various ways... Within this research I came across a strange thing that was the parameter passage…
-
2
votes0
answers98
viewsHow can I internationalize the text within my Joptionpane
I managed to internationalize most of my code, but I can’t change the JOptionpane of the Alterarempresa button My code is like this at the moment. package Empresa; import java.awt.Container; import…
-
2
votes1
answer651
viewsHow to just send messages to other customers?
I have a question with java sockets. My code sends messages to all customers, including what you send. I want it to send only to other customers. Is there any way to do this? I test using the…
-
2
votes2
answers1178
viewsJava - Enter function
In the system there is a field, the person needs to fill this field and then press enter. By pressing enter the system does a check and then opens a JOptionpane asking to select: yes, nay, okay,…
-
2
votes1
answer226
viewsJPA+Hibernate releasing update alone
Hello, I have an object that is managed by Hibernate. On screen, an attribute of this object is updated the value and Hibernate immediately triggers an update in the database, without even going…
-
2
votes1
answer2263
viewsBank Account Validation Rules
Where do I get official bank account validation rules and check digit? After a lot of searching on Google, I can only find rules from ten years ago and on forums, with no source reference. I heard…
-
2
votes1
answer519
viewsCompare lines with txt Java Android
I would like to create a method that compares each line of my text view with each line of a txt file here I go through the txt file for example, in my text view are displayed the words blue green…
-
2
votes1
answer1354
viewsConsume a Restful Service with Angularjs
I did a project in eclipse with a service Rest in java, if I run directly in the browser my service it returns my data right: http://localhost:8080/Agenda/rest/Agenda/getLista Now I want to consume…
-
2
votes1
answer395
viewsCalendar.MONTH returns incorrect month
I’m developing a method where I can get the date, month and year, to create a security key to connect to the server. Only I already checked the date of my emulator and my mobile phone is correct,…
-
2
votes1
answer217
viewsClient sending String[] instead of Bigdecimal to server when changing
When it’s a re-registration works peacefully, the problem is in the alteration. I own an object To who is the master, another object B which is a ArrayList and detail of the master To and finally,…
-
2
votes1
answer143
viewsHow do I use Page in this query instead of List?
@Query(value="SELECT * FROM prot_protocolo where status = 'PENDENTE' AND departamento_id=?", nativeQuery=true) public List<Protocolo> findByProtocolosPorDepartamento(String id); The page does…
-
2
votes2
answers3199
viewsWhat is the convention for using upper and lower case names in Java?
I once read somewhere about the best practices of using upper and lower case when you name the methods, attributes, variables... in Java, someone could refresh my memory?
-
2
votes1
answer80
viewsJava library error in project
The libraries of my project are not importing the classes of *util and several others also, I do not know what is happening, because when I create a new project these classes and libraries work.…
-
2
votes1
answer91
viewsUse Datepicker in an Activity
Hello! , I am trying to make a datepicker part of the Activity layout as shown below: I’ve been searching the Internet, but all the examples I find speak of Datepickerdialog, and that’s not what I…
-
2
votes0
answers139
viewsHow to post user status on facebook?
I made an app on facebook and took the app_secret I finally got everything, the goal is for the user to publish in his own timeline however, I can even publish but only in my app and with the login…
-
2
votes1
answer47
viewsHow to manipulate the returned object by envelope.getresponse()?
I’m having difficulty to catch an object that resume my connection with the server, I log in and it returns me a getResponse. response = envelope.getResponse(); In this report comes the client code…
-
2
votes1
answer244
viewsError opening jar on command line
I have the following code and am using a library to list the citizen card fields. When I try to run in the DOS it doesn’t work. import java.io.*; import pteidlib.*; public class main { public String…
javaasked 9 years, 1 month ago usersantos 765 -
2
votes1
answer873
viewsHow to set basic requirements to run Java desktop application?
How do I identify the minimum requirements (RAM, processor, etc) for my application to run? I don’t have multiple computers to test with multiple situations. The computer I use for development has…
-
2
votes2
answers143
viewsSeparating a String, how do I do?
I have a: String url = intent://instagram.com/_u/fabiohcnobre/#Intent;package=com.instagram.android;scheme=https;end How do I separate her so that I get one String link =…
-
2
votes2
answers560
viewsHow to create shortcut to open a Jmenu?
Speak guys, does anyone know how to create a keyboard shortcuts method to open a Jmenu. For example, click F1 or CTRL + "something" and open a screen.
-
2
votes1
answer1517
viewsCreate Jframe with label?
How to create a Jframe, containing a Jlabel with text, and can be positioned anywhere in the frame. I need this label to be anywhere in the frame area.…
-
2
votes1
answer63
viewsError in user registration, changing user instead insert
My problem is the following, I saw that when I edit a record , it works, the registration is changed, but when I want to register a new user, it falls in the editing condition, it edits the…
-
2
votes2
answers133
viewsCheck if the installation source is from the play store
Hi, I was thinking of doing a version PRO(unannounced) from my Android App, only I would like to know how the source check works, whether it was installed by the play store or the user under the apk…
-
2
votes1
answer1035
viewsHow do I remove a view created in java code by the id of this view?
How do I remove a view by Id. Because in my application it has an "add" button to add a group of components that "group" is a LinearLayout has a field and a delete "X" button. When the "X" button is…
-
2
votes1
answer243
viewsHow do I define column size?
I have a query screen, and I would like to define the size of the columns, because some columns take up more space than necessary. I thought that if I made a comparison with the title of the column,…
-
2
votes1
answer400
viewsJava Speech API, in Portuguese
It is possible to generate a voice synthesizer using the API Java Speech, but with accent Aportuguese? I don’t know much about Java, if it is possible to detail the answer, I thank you.…
-
2
votes1
answer666
viewsorg.xml.sax.Saxparseexception; lineNumber: 10; columnNumber: 24; Attribute "Singleton" must be declared for element type "bean"
I am upgrading a (old) project to the latest libraries, such as Spring (from version 3.2.4.FINAL to version 4.3.11.FINAL). One of the errors that appears in Tomcat 6 is:…
-
2
votes1
answer97
viewsIs it possible to open windows generated from netbeans in Window Builder?
I migrated some projects in swing netbeans with windows generated by GUI-Builder for Eclipse, but Window Builder cannot generate screen design by reading files .java created by netbeans. It is…
-
2
votes1
answer65
viewsError of Nullpointerexception
Caused by: java.lang.Nullpointerexception AT dao.Database.verificaSeTemRegistroNaTable(Database.java:184) That error was presented in mine logcat. The method: public boolean…
-
2
votes1
answer2012
viewsHow to exchange point for comma in java and Bigdecimal type?
I’m a beginner in java and I’m having doubts about the type BigDecimal, Because he accepts points, not commas. I am developing a software for video rental and want to save the value of my category…
javaasked 9 years, 1 month ago Igor Contini 663 -
2
votes1
answer92
viewsWhy is Floatingactionbutton transparent?
I’m having a problem after I updated lib support.design:22.2.0 to 23.0.1, the floatingActionButton is transparent when executed in API 10. Here is the code:…
-
2
votes2
answers58
viewsLinearlayout dimensions, defined in java, do not maintain proportionality between resolutions
I have a View in which I am programmatically defining its somersault and width in this way: LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) linear.getLayoutParams(); params.height =…
-
2
votes1
answer498
viewsjava.lang.Classcastexception: Converter JSF error
I am implementing the Converter below: @FacesConverter(forClass = Cargo.class) public class CargoConverter implements Converter { @Inject private CargosRepository cargoRepository; public…