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
votes2
answers413
viewsHow can I put a button to make it visible?
How can I click a button and make the other button visible?? Button vibrar; cor = (Button) findViewById(R.id.cores); public void clica (View View){ cor.setVisibility(View.VISIBLE); }…
-
1
votes1
answer586
viewsMultiple buttons (Jbutton) with the same function in different Jpanels
I’m making a program (using the Netbeans GUI Builder and Cardlayout) with multiple screens (multiple Jpanels) and they’ll all have a start button, which obviously goes back to the home screen. I…
-
1
votes2
answers53
viewsError using values string
Hello, I’m using string within values. Everything is working fine, but when the phrase is composed of something that comes from the bank (for example) and a string, it is putting numbers instead of…
-
1
votes1
answer1032
viewsMargin of a Document iTextPdf
I am working with an existing PDF file, follow the small line of code: //Código... document = new Document(PageSize.A4); PdfWriter writer = PdfWriter.getInstance(document, fOut); document.open();…
-
1
votes1
answer99
viewsE-mail with a custom html page - android
Good afternoon, Someone can help me, I am developing an app, where after receiving some user data, is performed sending an email containing this information. I’d like to use html to make the email…
-
1
votes0
answers39
viewsModal of absolute loading
Good afternoon, I would like to know how I can make my loading stage absolute on my main stage. Since, as the code below I am setting the X/Y based on my main Stage, however when moving the main…
-
1
votes1
answer339
viewsonActivityResult does not return setResult
What happens is that I have an Activity Client where I have 2 buttons, one for registration and another for consultation, when I call the registration opens an Activity with a Tabhost with 2…
-
1
votes1
answer186
viewsSelect Hibernate criteria with mapped entity
has how I make a select, using the criteria and bring an uncharted entity, would be several joins, and sometimes bring certain fields and others not.
-
1
votes1
answer1750
viewsLabel printing with barcode on Argox printer (USB)
I am developing an application where I need to generate and print barcode on a label through the printer Argox with USB connection. Despite being a web application, the system will run locally, that…
-
1
votes2
answers264
viewsSession Hibernate, how to obtain instance
In all the Hibernate documentation, and web-based examples have this code example, or a very similar one, to use Hibernate. List<Object> list = session.createCriteria(Object.class); Since…
-
1
votes2
answers383
viewsHow do I manipulate the order of the files in an Arraylist?
I am developing a program, in which part of the processes requires me to take the numbering of the last file listed within a ArrayList. My doubt is this, when mine ArrayList starts adding the files…
-
1
votes0
answers1784
viewsParagraph iTextPdf line spacing
I’m using a very large text and adding directly in iTextPDF’s Paragraph, but the space between the lines is very large, I wanted to control the spacing between the lines, but I can’t make any…
-
1
votes3
answers752
viewsComparison between objects through loop, If and Else?
I’m beginner in java and I’m having doubts in comparing objects by means of loop. I am developing software for a video rental company with Pattern MVC (Model-view-controller) design and I want to…
-
1
votes1
answer957
viewsError while running Android Studio emulator
I’m having a problem when emulating a device in android studio. When I try the following error happens: 15:28:24 FileNotFoundException: /home/Henrique/. android/Avd/3_2_HVGA_slider_ADP1_API_17.ini…
-
1
votes1
answer295
viewsSave data to file in android internal memory
I need to record a set of variables: int var1,var2,var3 var4=new int[10], var5=new int[10], var6=new int[10] var7=new int[5][3],var8=new int[5][3] My goal was to record them all in order and then…
-
1
votes2
answers437
viewsQuestion how to submit a JSF form using <p:confirmDialog>
I wanted to know how I send a form using the p:comfirmdialog. The idea is to get the message tem certeza ?, with the options sim or não. If you click sim, then it sends the Form. <p:commandButton…
-
1
votes1
answer266
viewsUpdate graphicImage after fileupload
I am trying to update the photo form when I send the image through the dialog via fileupload. The photo only appears after I press F5. <h:form id="form"> <h:inputHidden id="idPessoa"…
-
1
votes2
answers2390
viewsUnderline a word within a Textview
As I can underline, leave in bold/italic a single word within a TextView? for example: <TextView android:text="Abelha Barco Casa Dado" android:layout_width="wrap_content"…
-
1
votes1
answer153
viewsDelete method (Restful)
Would you like to know how I make a delete method that gets a list by parameters? I mean, instead of just passing the ID of the item to be deleted, I want to allow you to be selected N items and…
-
1
votes2
answers586
viewsApplication does not save data and only saves code
I’m developing software for a video rental company with Pattern MVC design (Model-view-controller) and the problem of not saving people is occurring. It only saves people’s code and I don’t even…
-
1
votes1
answer551
viewsButton effect pressed
I have several buttons on an app and wanted them to have the same effect as Button when pressed, because there are several buttons, I would like to create a code in JAVA for this and not by the…
-
1
votes2
answers89
viewsHow to make a regex capture a large variation of a term? (HOUSE, House)
It is as follows: since it has a term that I wish to capture, for example, "HOUSE", how to make a regex to capture many variations of this word, example: House, House, House, House, House, House...…
-
1
votes1
answer172
viewsError creating project with Java with Jhipster
I’m creating a project by Jhipster in windows 10. When running the yo jhipster command and selecting the tools I will use I get the following error when creating the project:…
-
1
votes2
answers446
viewsWEB Service in Java
I’m creating a Web Service, but I’m having a lot of doubts about how to receive JSON as a parameter. @Path("WebService/{json}") @POST @Consumes(MediaType.APPLICATION_JSON)…
-
1
votes0
answers143
viewsMask for CPF and Date using <p:Keyboard> Primafaces
I looked at several websites on this subject but found nothing to solve my problem. Come on, I have two fields one for CPF and one for Date of Birth both using the "Keyboard" component of…
-
1
votes1
answer459
viewsField read HTML tags in JSF
I would like in my field that I will add the text and send to the database, add for example an ex link: <a href="http://www.globo.com/" ></a>, however, when printing on the screen,…
-
1
votes2
answers4588
viewsdefine environment variable in application.properties
I have a project in Spring boot where in application.properties I wanted to define the location of files that I will process. I don’t know the best way to do it. I wish I had the directory…
-
1
votes2
answers955
viewsHow to print the day numbers of each month using Array, String and byte?
I’m trying this code, but it doesn’t work. public class MesDias { public static void main(String[] args) { // Array String byte String Mes = {Jan, Fev, Mar, Abr, Mai, Jun, Jul, Ago, Set, Out, Nov,…
-
1
votes1
answer157
viewsQuery Mysql confusing results
I have to make a mysql query through a Java method. This is the sql I did to test if it works: select * from servicos S, clientes C, motores M where C.nome = "Claudio Fernando Pires" group by…
-
1
votes1
answer59
viewsDatabase + java
How do I check for a database in java ? Example: If you do, create a new.
-
1
votes1
answer64
viewsError inserting data with Hibernate
I’m having an error inserting into my database: ERROR: You have an error in your SQL syntax; check the manual that Corresponds to your Mysql server version for the right syntax to use near 'de…
-
1
votes2
answers1219
viewsHow to pass object list to Subreport?
I have the iReport plugin in netbeans. I’ve already set up the classpath to recognize my classes, I take the following steps: 1 - Send object list Boletim for the main report, each report has…
-
1
votes1
answer950
viewsTo display a list of images with saved path in the JSF2.2+ Primefaces 4 database
I’m having trouble displaying images on a datagrid using both img and graphicImage passing to these tags the path of the database. Could someone help? I’m using Tomcat 8. The last way I tried was…
-
1
votes1
answer332
viewsjava.lang.Nosuchmethoderror: org.hibernate.cfg.Environment.verifyProperties(Ljava/util/Map;)V
Work in a Java project and when changing the machine I had to inform the libraries of the project again, but when compiling this generating an error in the output. Exit: Exception in thread "main"…
-
1
votes2
answers1205
viewsCall Another Layout
When entering email and password the app should call another layout. I just can’t seem to do it... Intent intent = new Intent(this, R.layout.activity_estado); startActivity(intent); Informs the…
-
1
votes1
answer351
viewsAndroid Listview customized in a Fragment
I have an app layout was made in tabs and in one of them I would like to implement the ListViewcustomized, but I could not because the JAVA class tab extends the class fragment and to make the list…
-
1
votes0
answers98
viewscould not resolve Property: funcionario of: br.com.horasExtras.domain.Funcionarios
I am working on User authentication, this is my code AutenticacoaBean. When I click the login button of my authentication screen, the following error occurs: could not resolve Property: funcio of:…
-
1
votes1
answer106
viewsIs it possible to activate the Operating System context menu in swing application?
Some time ago I realized that it is not possible to call the operating system context menu in swing components, although it is possible to perform standard keyboard actions (such as copy, paste,…
-
1
votes0
answers73
viewsConvert Bitmap to Mat
Hello, I am trying to grab saved BLOBS in a Sqlite database and convert them to Bitmap. After that, I need to convert these Bitmaps into Mat, to use with Opencv. The problem is that when I open the…
-
1
votes1
answer133
viewsSave data to DB and recover ID automatically
This is the code to save to the bank using the default DAO, where I want to recover the id record to save the table Usuario who owns the FOREIGN KEY table Habilitacao: public int…
-
1
votes1
answer108
viewsHow do I send a message telling the user the start date is longer than the end date?
I spent all afternoon making this code but I couldn’t get it to work properly. What do I do to send a message to the user saying that the start time cannot be longer than the end time? xml: <?xml…
-
1
votes1
answer165
viewsDoubt Receiving parameters (Webservice Soap)
Guys, I’m having doubts in the following scenario: I have this class, it is a webservice (contains the @Webservice method): @WebService(name = "l", targetNamespace = "o") public abstract interface…
-
1
votes2
answers77
viewsNullpointexception in the register method
Does anyone know how to solve this nullPointExcetion? In the second way I am using two combobox Follows the class Clientedao package DAO; import Beans.ClienteBeans; import Utilitarios.Conexao;…
-
1
votes0
answers534
viewsUpdate project when running Maven
I have a java project with Maven stacks. I changed some java functions and applied the command again mvn clean install by the prompt. But when it is time to execute it does not update the code, it…
-
1
votes1
answer1242
viewsHow to leave the first character uppercase on the keyboard?
How to start keyboard with uppercase letter for the user to start writing without having to tap the arrow to make the letter uppercase? I used android:inputType="textCapCharacters" but it didn’t…
-
1
votes0
answers32
viewsHow to draw an image from scratch using the drawimage or drawRGB method on J2ME in Sun WTK?
Does the method drawimage or drawRGB can create from scratch any image or graphic or icon in png format for j2me games or not? Will I draw an image using the method drawimage or drawRGB without…
-
1
votes1
answer575
viewsHow to send Lists with Retrofit 2.0 via POST
I have a list of records and need to send to the server via POST, use Retrofit 2.0 to make the requests. Be able to make all requests, but I’m not able to send the list. My interface: private…
-
1
votes1
answer467
viewsPersist JPA object array
I’m trying to persist a ArrayList of Entity in JPA with the following for: EntityManagerFactory emf = Persistence.createEntityManagerFactory("PU"); EntityManager em = emf.createEntityManager();…
-
1
votes2
answers120
viewsspinner change image cause error: Out of Memory on a byte allocation
I have a normal spinner working perfect and I have the following code : import android.app.Activity; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import…
-
1
votes3
answers1781
viewsHow to validate a double field?
Good afternoon guys, I’m not able to validate the field type value double The field I cannot validate for the registration is the field valor. Follows the class method to validate the data to…