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
answer268
viewsConvert Jsoup doc to string, apply Regex and return a value in String
I’m using an example I found called Androidjsoup to get the source HTML from a certain page, but I’m not getting just the snippet of code I wish is in a certain <script> In short, the…
-
1
votes0
answers118
viewsMake internet application available only for intranet
I have an application running on an external server, accessible to anyone who has the URL. However, I need you to only have access to certain groups that are on the intranet. Example: "Employee A"…
javaasked 8 years, 7 months ago Thiago Almeida 21 -
1
votes1
answer97
viewsWould it be possible for me to connect to a java server using basic Socket using a Javascript client?
I am studying game development and lately considered developing a game next or even online. There are two Ides where I can develop games, Unity3d and RPG Maker MV that use javascript. I’m a beginner…
-
1
votes1
answer93
viewsReturn results from a query
how do I return a value from a "SELECT" method? I have this code: public void SELECT(String Colunas,String Tabela,String Condicao) { String QUERY=null; if(Colunas!=null && Condicao!=null)…
-
1
votes1
answer469
viewsEdit FXML Button text
I cannot change the text of the button created in FXML. Even if I put inside the initialize(... butao.setText("..."); he doesn’t change. What I do? Personcontroller, intializable: @Override public…
-
1
votes1
answer295
viewsHow to take data from a form and play in a PHP Array
I have an Android application, which creates a TXT file in PHP, bringing the data from the XML form of Android itself. See the code: $f = fopen('POST_DATA.txt', 'a'); fwrite($f, 'ID: '.$id."\r\n");…
-
1
votes1
answer537
viewsString Error CPF Android
Does anyone have a CPF code for validation on Android? I have the following code: public static boolean validateNotNull(View pView, String pMessage) { if (pView instanceof EditText) { EditText…
-
1
votes0
answers227
viewsThe JSON array does not want to pass everything to my listview
Here’s my mistake, when I run the app in the emulator, the app does not receive a single title from array JSON, does not close the application, the only error that is in logcat, was supposed to be…
-
1
votes1
answer583
viewsListview of Android database - Close application with error
I’m implementing a registration with Sqlite3 on Android and so far okay, the problem is in the call of Activity data listing when the registration is successfully performed, when making the call to…
-
1
votes1
answer253
viewsJava crashing on windows server
Guys I’m having a problem, I have an app running on server 2012 ,the problem is that after a couple of days the java hangs and does not give me any error , I have to finish the java and open again…
-
1
votes1
answer1077
viewsWhat is the function of @Override in Java?
Seeing some code or even creating an automatic method I noticed the presence of it @Override. What he really does in the code?
-
1
votes1
answer1526
viewsCalculate delta value for assertEquals in Junit
Greetings. How best to calculate the delta value of Junit’s assertEquals(message, expected, actual, delta) method?
-
1
votes1
answer143
viewsShortcut to main panel via Jmenuitem
I’m working on eclipse Mars 2.0, where do I use the windowBuilder, and I’m having trouble turning on the shortcut: Consultar -> Dia (mntmDia) to the main page panelConsultarDia, that is, when…
-
1
votes1
answer476
viewsJdatechooser and Jcombobox picking blank values
I’m having some problems trying to capture the value of some elements of my code. 1º - Problem with Jdatechoose component The code runs smoothly but the captured value goes blank, follows code…
-
1
votes1
answer121
viewsChange programming language pro APK
I have a App in Playstore I did using the Ionic/Cordova, the App hangs a lot on the smartphone and for this reason I would like to create a new App from scratch using another programming language,…
-
1
votes0
answers54
views -
1
votes1
answer319
viewsTaking reserved SQL words out of a Java string
I’m making a view that has an open field (textarea) where the user can write SQL and then run the same SQL. The point is that the oracle user where it will run SQL has permissions for everything and…
-
1
votes0
answers48
viewsUpdate activity from Alertdialog
Every time I click on Toolbar I have a menu that when clicking on one of the options I see a AlertDialog. This Alertdialog has a setSingleChoiceItems, where the user choosing an option and clicking…
-
1
votes1
answer322
viewsBring only the name in Listview, but relate to the ID
I have a Webservice that lists all my users and brings users from the bank. I have a class Usuario { int id; String nome; } With its builders, gets and sets, etc. And I can return all my users.…
-
1
votes1
answer90
viewsNullpointer Exception error when bringing Fragment data
I have a Nullpointerexception error when trying to return data from a Fragment. NPE error is right on this line: String comentarioFoto = fragment_obj.campoComentarioFoto.getText().toString(); Check…
-
1
votes0
answers60
viewsString to Date conversion using an html form
I’m having trouble converting String to Date, here are the codes: Event: @Entity(name = "Evento") @Table(name = "evento_table") public class Evento { @Id @GeneratedValue(strategy =…
-
1
votes2
answers900
viewsEnable Jbutton from selection in Jtable and remove the initial focus from the table
I have a window with a JTable, where only an entire row is valid, not just one field. The point is that the window already opens with the first line selected, and I’d like to disable that. In that…
-
1
votes2
answers858
viewsHow to check if a table exists using jdbc java
How to check if a table exists in jdbc using Sqlite3?
-
1
votes1
answer52
viewsWhat is this code possibly doing?
index.xhtml : ui:repeat value="#{produtoService.listaProdutos}" var="prod" Note: I know I have to close the tags. But that is, what this code is doing ('assuming' that the tags are closed…
-
1
votes0
answers38
viewsJava-ee, primefaces component order list
Has anyone ever worked with the first-face component orderlist? Because I want to use it in my project and I’m not getting it, could you help me? You are generating an exception and also do not know…
-
1
votes2
answers6836
viewsEdit object stored in an Arraylist
I have the class Contato: public class Contato { private String nome; private String email; private int telefone; /*getters e setter*/ } And the class Agenda who has a ArrayList called "contacts"…
-
1
votes1
answer765
viewsHow to access the value of a private attribute in a Java class without a public method?
How can I access the value of a private attribute in a class, a class in another package, without using an access method, such as a getter? class Person{ private String name = "Someone"; } Why would…
-
1
votes1
answer67
viewsHow to create a Weakhashset /Weakset in Java
The java.lang.ref package offers classes that model reference types in Java, such as Reference, Softreferece, Weakreference and Phantomreference. Still not familiar with these references in Java?…
-
1
votes0
answers99
viewsShow and receive response from a p:confirmDialog triggered via Managed/CDI Bean
I have a view with a save button, but the method that runs on the save button does some checking on the bean and asks the user if they really want to save. Show dialog:…
-
1
votes0
answers748
viewsView PDF in a Dialog
I am wanting to change the way the user views the system report I am developing, currently by clicking the button to view the report, is given the option for the user to download or open directly in…
-
1
votes0
answers33
viewsHow to make a formula that is saved in string be calculated?
The user can enter a formula in a String type String formula = (100+20+10)/50*1; What I need to do is take this formula and do the calculated code to issue a result. I thought to do with conditions…
javaasked 8 years, 7 months ago joao paulo santos almeida 486 -
1
votes0
answers57
viewsIs there any self help api
I wonder if there is some auto help api, where it shows information about the field content something like a detail, about how the user should add information in that field ? Does anyone know…
-
1
votes3
answers303
viewsJSF - Selecting Item from a Set
I want to make a xhtml that returns a list of users and next appears a button to select a particular user. Something like this: +----------------------------+ | ID | User | (Button) |…
-
1
votes1
answer3521
viewsDiscover the object class in Java
I have a set of functions to configure a set of parameters in Java like this: public void Util.setParametros(Integer par) {} public void Util.setParametros(String par) {} public void…
-
1
votes1
answer6279
viewsConvert String to Double while maintaining content
I need Java to convert a String which has a binary value (Ex: "0111010") for a double. I tested: String teste = "101010101"; double number = Double.parseDouble(teste); System.out.println("The number…
-
1
votes1
answer900
viewsJSF - how to send information to another page
I have a orderList for the operator to select the customer’s name. After he selects I need to direct him to another page with the customer’s data. How do I pass on customer information that has been…
-
1
votes1
answer54
views24x5 process in jar how to convert to . War
I created a jar to calculate forex signals, but I’d like to host it on some cloud server. As I’ve been researching, it will be much easier to convert it to a War. Since my app should run 24x5, I…
-
1
votes1
answer329
viewsPick string from a textarea and populate an object
I wonder if there is any API,plugin, something of the kind, and of course some idea how I can get a pre-formatted text, like this: Cod Nome Celuler Telefone Tel_trabalho 123 Bruno 986159946 27054578…
javaasked 8 years, 6 months ago Bruno Tinelli 34 -
1
votes0
answers216
viewsIs it good programming practice to write a while with true argument so that it runs endlessly?
In a hypothetical situation: Is it good programming practice to write a while that way? So that it continues to run endlessly? while(true){ System.out.println("Por favor, Escolha: ");…
-
1
votes1
answer188
viewsCrawler to make pagination
I need a Crawler who makes pagination on a website. I’m reading the source code and generating a txt that way public class CodFonte { public static void crawler(String str) throws IOException { URL…
-
1
votes0
answers279
viewsError: Java.lang.Stackoverflowerror:, com like no Hibernate(loop Query.getResultList())
I have a method: public static List<Texto> getTextoPorIdAlternativoLike(String idAlternativoTexto) { Texto texto = new Texto(); String where = "t.idAlternativo like :idAlternativo";…
-
1
votes1
answer107
viewsHow to separate an array of pairs into sets?
I need to solve a problem in java and I’m having difficulties. I have the matrix with the following pairs: 0 - 1 1 - 2 2 - 4 2 - 5 3 - 6 4 - 5 6 - 7 I would like to group these figures as follows:…
javaasked 8 years, 6 months ago RafaelPinheiro 83 -
1
votes1
answer100
viewsJava problem in Mathcad and Modefrontier integration
I’m testing the modeFrontier with a simple multi-purpose optimization problem of ESTECO A simple multi-objective Optimization problem Modefrontier can generate input variables h and r but cannot…
-
1
votes0
answers40
viewsOracle10g integration with Sql Server 2008 via JDBC
I need some help, I have a system that integrates Oracle with Sql Server, that worked perfectly but Sql Server was 2000, it was upgraded to Sql Server 2008, it used the jdbc 2000 driver, now I…
-
1
votes2
answers216
viewsReturn information from a String
I’m trying to return the information from a String. What I need is to pass a String parameter and return the information that is in the indicated places. Ex.: String FraseParametro = "<R1>…
-
1
votes1
answer639
viewsCrawler to log in to the site of nota fiscal paulista
What I got so far is this: package br.com.crawler; import java.io.BufferedReader; import java.io.DataOutputStream; import java.io.InputStreamReader; import java.net.URL; import…
-
1
votes0
answers42
viewsGoogle Maps point dialog box
I have some points marked on a map, I would like that when some point was selected, open a dialog box with two options, get information of the point and trace a route to it. How could I do that?…
-
1
votes1
answer756
viewsHow does the MVC+ Service layer architecture work?
I’m trying to find some documentation for this, if anyone has a book that addresses the subject please inform.
-
1
votes0
answers63
viewsSum of items when changing a record
I have 3 items Accessories, Tires and Vehicles, the values are added to a maintenance screen that is the main one. The problem is that when it is to change only one of the items, the added value is…
-
1
votes2
answers84
viewsStackoverflowerror when calling a class
public class MainActivity extends ActionBarActivity{ Conexao c = new Conexao(); public void tela(){ c.CriaBanco(); } } public class Conexao extends MainActivity{ String NomeBanco = "Cadastro";…