Questions tagged as 'java'

2
answers

How to create JButton in "square" format?

Is it possible to create JButton in a "square" format, without the rounded corners when they are already in JFrame ? Does anyone have an example? I do not use any specific laf, but the netbeans default. The JButtons is nothin...
asked by 07.09.2015 / 16:20
1
answer

How to declare and initialize two-dimensional arrays?

I have to save the row, column and contents of a worksheet. For this I created a two-dimensional matrix. My difficulty is how do I initialize it? I believe the statement is no longer correct because I get ArrayIndexOutOfBoundsException . I...
asked by 15.04.2015 / 14:59
1
answer

Execute cmd commands by Java

I would like to know how I do to run cmd commands in java. Well, I did this: import java.io.*; public class Commands { static final Runtime run = Runtime.getRuntime(); static Process pro; static BufferedReader read; public static void main(...
asked by 06.04.2015 / 04:05
1
answer

How to include a jar when executing a Java file by command line

Whenever I run the program I need to call a specific library, which in this case is /home/usuario/Programas/weka-x-x-x/weka.jar , but every time I run the program, I have to include the following java -cp /home/usuario/Programas/weka-x-...
asked by 16.03.2015 / 18:56
1
answer

com.google.firebase.database.DatabaseException

I looked for this error and found nowhere, just some resemblances but not this:    com.google.firebase.database.DatabaseException: Maps with non-string keys are not supported Controller (where error is): final DatabaseReference banco =...
asked by 16.11.2017 / 20:28
2
answers

Iterator Function

I have an absurd doubt with Iterator, I'm doing an exercise in which I have a Data class that checks the existence of the date, this is working perfectly, in my main I make an array of date and I setData in some Data d[] = { new Data(), new Da...
asked by 03.05.2018 / 21:10
1
answer

Different regex strategies to get the same result

I have the following input: Detalhamento de Serviços nº: 999-99999-9999 I need to get the number in a group, for this I would use: Detalhamento de Serviços nº: (\d+-\d+-\d+) But I can not trust whether or not there is the string nº:...
asked by 18.05.2018 / 20:05
1
answer

Comparison between dates

I'm trying to validate the inclusion of dates in my system, referring to the batch of products, but I think I'm a bit hasty in the way I'm doing. For what I need, I thought of 3 situations that I should control, which would be them:    The...
asked by 02.09.2017 / 18:53
2
answers

Regular expression that supports at least two of the four conditions

I'm writing a regular expression for validating a password. I wanted to know the easiest way to make a regular expression accept at least two of these conditions: Uppercase letters Lowercase letters Special Characters Numbers A...
asked by 27.07.2017 / 17:55
1
answer

Pass as parameter the "visibility"

How do I pass a visibility parameter and then set it? Ex: private void _setVisibility(View.VISIBLE a){ _viewLineStatus.setVisibility(a); }     
asked by 01.09.2014 / 20:51