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
-
1
votes1
answer93
viewsError summing Edit Text fields using Onfocuschangelistener
I’m trying to get my application to calculate the fields EditText cost price plus profit percentage and when clicking on the sales price field the result already appears, but instead of appearing…
-
1
votes2
answers6645
viewsWhat is the function of wrap_content?
RelativeLayout onCreateLayout = new RelativeLayout(this); onCreateLayout.setBackgroundColor(Color.CYAN); RelativeLayout.LayoutParams ClickMeParms = new RelativeLayout.LayoutParams (…
-
1
votes0
answers100
viewsKeep Swagger documentation updated
I am documenting an API with Swagger. I am not using annotations and the documentation is recorded in a JSON file. The problem is that API is constantly changing and with each change you need to…
-
1
votes1
answer951
viewsPrimeface components do not appear
Guys good afternoon already tried everything change the url of web.xml to *.xhtml but it will not, I added the library primefaces in the lib of WEB-INF, but the components do not appear. My web.xml.…
-
1
votes1
answer137
viewsHow do I apply monetary mask to my listview?
I would like to know how to implement my monetary mask on ListView products. I ask you to be the most specific and detailed as I do not have much experience. Thank you. public class ProdutoAdapter…
-
1
votes1
answer308
viewsProblem inserting object with Manytoone JPA
I will try to exemplify my problem with simpler classes than in my application: I have for example the Main class and an Item class. In Main, I have a property of type Item annotated with Manytoone,…
-
1
votes1
answer240
viewsDoubt with the Lexical and Syntactic Analyzer Generator (GALS) switch
GALS generates the code in Java. I want to put it in the eclipse to make a screen and such. I was told that in the method nextState class lexico, have to put a switch with some numbers. But where do…
-
1
votes0
answers75
viewsError if project name is not "secsu"
Hello, today I created a project to test with the name "secsu" and it works perfectly, but when I try to change the name(Refactor > Rename) he simply of error. Code: package secsu; import…
-
1
votes0
answers537
viewsInsert in mysql database with java
I’m trying to give 6 insert in 6 tables, but I did not succeed that way, someone can help me with a better idea? private void salvarActionPerformed(java.awt.event.ActionEvent evt) { DadosFuncionario…
-
1
votes1
answer172
viewsAdd Jinternalframe to another Class
I own a JInternalFrame for editing budgets, my JDesktopPane is in a different class from the class I call the JInternalFrame, how to add the JInternalFrame in the JDesktopPane. Start Class public…
-
1
votes1
answer430
viewsDoubt in the use of Socket in java on android
I want to implement data transmission via Socket, I’m trying to implement Socket.io but I don’t understand how it works. I want to communicate between two android devices. I know you have the server…
-
1
votes1
answer109
viewsAndroid how to optimize a large chain of ifs
I would like to know how to optimize a large chain of ifs so that the code becomes more efficient and readable. My Android application uses version 2.3.3 (API 10), in this application I have an…
-
1
votes2
answers755
viewsGeneric DAO with CDI error = cannot be cast to java.lang.reflect.Parameterizedtype
I’m trying to implement a generic CDI DAO. Apparently I’m doing it right, but I’m getting the following error: cannot be cast to java.lang.reflect.Parameterizedtype This error is pointing me to this…
-
1
votes0
answers67
viewsPopupmenu appearing at the top of the screen
I did an implementation of a PopupMenu being called within a Adapter of a ListView, the mistake that this happening is that when I call the PopupMenu, the same is being displayed at the top of…
-
1
votes1
answer35
viewshow to know if a class is immutable by Javadoc?
I would like to know if by how, by Javadoc know whether a class is immutable or not. There is some field in Javdoc for quick query, as I am using several classes and do not have much contact with…
javaasked 7 years, 5 months ago Sergio Souza Novak 513 -
1
votes1
answer346
viewsError : Class org.firebirdsql.jdbc.Fbdriver has Unsupported major or minor version Numbers
Guys I’m making this mistake Somebody knows what it is : An Error Occurred: java.lang.Unsupportedclassversionerror: Class org.firebirdsql.jdbc.Fbdriver has Unsupported major or minor version…
-
1
votes1
answer802
viewsPass array as parameter
I have a question about arrays. So I have the following code: public static void main(String[] args) { //Objetos..... ColeçãoCidades ListaCidades = new ColeçãoCidades(); //Adicionar regiões Scanner…
-
1
votes2
answers816
viewsHow to save a file to Javafx or Java?
Code I tried to make, but it doesn’t work: Javafx FXML Application: salvar.setOnAction((ActionEvent e) -> { Stage window = (Stage) cont.getScene().getWindow(); try { String corpo =…
-
1
votes1
answer61
viewsImporting images from Google to the Android app
I’m building an App in which I want it to allow, through a button, I choose images from the gallery and include and save inside the application. But I have a problem IMAGE_GALLERY_REQUEST because…
-
1
votes2
answers1841
viewsHow to treat division by 0
I have the code where there can be a division by zero: Binding binding = new Binding(); GroovyShell shell = new GroovyShell(binding); conta = shell.evaluate(conta).toString();…
-
1
votes2
answers413
viewsReverse
package pag1; import java.util.Arrays; import java.util.Scanner; public class ex3 { public static void main (String[] args){ Scanner x = new Scanner (System.in); int posicao = 0; int[] numeros = new…
-
1
votes2
answers600
viewsMpandroidchart
I am using Mpandroidchart to make charts. The problem is this, when I have many items in the caption, it expands leaving the chart small. You can create a scroll in the caption instead of expanding…
-
1
votes1
answer100
viewsControl the session on android
I’m using Sharedpreferences to generate a session on android. I wanted to make a check that after a while (5 minutes for example), it give a timeout, reset this session and redirect to Login. You…
-
1
votes1
answer50
views -
1
votes1
answer774
viewsHow to put an integer number on a label
I’m trying to put a kind of score counter on a Jlabel ex: you hit a question the score goes to 1 , you miss and nothing happens to the score. I tried to do it that way : private void…
-
1
votes1
answer70
viewsCan I create a full app without using swing?
I’m creating a system and a question has arisen! Can I create forms without using Swing, AWT or the basic libraries in Java? If I use another framework, I can set aside Swing, AWT etc? What better…
-
1
votes0
answers112
viewsHelps port part of the Java code to C++
I am in a project and my 'responsibility' is to port the Java code to C++ that uses Opengl. I’ve done almost everything, but it doesn’t work. I think the problem is in this class that I could not…
-
1
votes1
answer368
viewsHow to draw GIF with Image and drawImage
I need to draw a GIF, I have the following code: public BasicBlock(String path, String name, int id, boolean gif){ this.path = path; this.name = name; this.id = id; File img = new File(path); try {…
-
1
votes1
answer1531
viewsEmail validation
How do I make this edittext only valid for an email? It contains, for example, [email protected] that contains at least the "@"? @Override protected void onCreate(Bundle savedInstanceState) {…
-
1
votes1
answer348
viewsHow to build a relative URL securely?
A method takes snippets from a URL and needs to concatenate them coherently, but without presupposing details about each one. Examples: http://server + /path + /resource.js =>…
-
1
votes1
answer42
viewsGet all Rows from a query
Friends, I have a little problem: I need to take each of the Rows of a query with a loop. I saw a code in Stackoverflow, but it doesn’t work. Anyone who knows how to do it, please let me know.…
-
1
votes1
answer112
views"Unfortunately, *my app* has stopped" in the data pass to Activity
I’m making an app that formats bibliographic references according to ABNT, but there’s been an error to pass the data typed by the user to the next activity, that displays the formatted data. Follow…
-
1
votes2
answers187
viewsjavax.servlet.Servletexception: java.lang.Exceptionininitializererro
I’m trying to create my first project using JPA, using Jboss 5, Oracle, Hibernate and primefaces. After deploying the project I try to create and insert a new client into the bank through the web…
-
1
votes1
answer38
viewsMonitor changes in the application
I need a class that listens for any changes in the application (or external changes). I made a class that extended from class Service, but I understand that it goes into the method onStartCommand…
-
1
votes1
answer34
viewsNaming subblocks of any metablock with a single class?
I am trying to make only one class necessary to name the subblocks of any metablock that uses this class at the time of the record, ie naming them as if they were parameter values, but without using…
-
1
votes0
answers1526
viewsBank Queue Management System
Hello folks I need a help I am learning to program now, I am developing a password system for waiting queue type JAVA database database. Password Normal; Password Priority; Call in Password Reclaim…
javaasked 8 years, 10 months ago Mauricio Fernandes 11 -
1
votes1
answer84
viewsIs with the same value as the last time it was used
How do I make the value of contador of for start with the same value as the last time it was used? Why this for always starts when I start to activity, and I need him not to start at 1 every time I…
-
1
votes1
answer530
viewsapplication with Full Screen
i am not able to put my app stay in full screen and just leave the navigation button. getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE |…
-
1
votes1
answer198
viewsHow to resolve Sqlite auto increment gap?
I have a code that erases one Row whole of a database, but there is a problem because I get a hole getting an ID without data (what I deleted) for this being autoincrement, does not delete the ID…
-
1
votes1
answer213
viewsHow to prevent onItemSelected from being called when using setSelection?
I have a ListView and within each item of it carries a Spinner with some information. The way I want it to work (Expectation): The first time you load the Activity, present to the user a list and…
-
1
votes1
answer71
viewsDisplay multiple columns
I am developing a basic program in Java Application (Desktop) that performs a simple registration and displays on another screen through a Jtable the recorded data in the same. My problem is that…
-
1
votes1
answer312
viewsShow sql generated by JPA/Hibernate
Is there any way to show SQL generated by JPA/Hibernate without enabling the property <property name="hibernate.show_sql" value="true"/>? The difficulty is that I need to monitor only one…
-
1
votes2
answers797
viewsAvoid opening more than one of the same Jinternalframe
I’m developing an application that uses JInternalFrame within a JDesktop. When I push the button, this one JInternalFrame is instantiated and the window is opened, however, if I press the button…
-
1
votes1
answer940
viewsConsume Webservice passing object as parameter
I have the Webservice and send the object Cliente as a parameter, I would like to know how to make it work, and it create a suitable WSDL when running Server, so I can make the call on a Client…
-
1
votes1
answer1531
viewsHow to use more than one extends?
When I create the project it comes like this public class MainActivity extends AppCompatActivity{ would like to use more of a extends how to do ? import android.support.v7.app.AppCompatActivity;…
-
1
votes1
answer59
viewsHow to get an authenticated user to see another user’s posts tbm authenticated?
When I take the node reference in the database and use Child to return the current user data, it works cool, but I don’t know how to implement the data return(posts) of other authenticated users in…
-
1
votes0
answers264
viewsIntellij JSF - Page opens in white
What I did I created a project Maven and added the module of JSF, however, even with the library downloaded. What’s going on When I run my project using the Tomcat, the page olamundo.xhtml comes…
-
1
votes1
answer379
viewsDate field not saved in Spring and Angular database
I am doing a small CRUD and na when I save the data the data fields Start and dataFim do not save in the database. PS: I did the debug and the dates are going through the save method. <div…
-
1
votes1
answer61
viewsEdittext with Mask
I needed a mask for a tractor horimetro with 5 fields a comma and a capo later. Example: "#####,#" I even found a cool Maskedit, follow the link: https://github.com/toshikurauchi/MaskedEditText The…
-
1
votes1
answer2684
viewsDecrease a Base64
How to decrease a size of a Base64 without decreasing the quality so much? I’m trying a problem in this code,because it’s too big and it’s not saving in the bank. How to decrease ? Bitmap thumbnail…