Questions tagged as 'java'

1
answer

How to change the font color of a JTextArea?

Throughout the internet I just found people wanting to know how to style part of the text and being "redirected" to JTextPane , so there are no answers to my question out there. So there goes: I have a JTextArea in a JFrame...
asked by 17.10.2014 / 15:52
1
answer

How to convert a Java project in Eclipse to a Maven project?

I have a Java project in Eclipse that I want to convert to a Maven project. For the conversion, I right-click and select the "Convert to Maven Project" as indicated in the figure below. Theproblemisthataftertheprojectconversionthesourcefo...
asked by 10.03.2015 / 14:12
1
answer

Applet does not run in browser

Does not run the Applet. Just give that feedback. Thisismyjavaclass.publicclassSiteSelectorextendsJApplet{privateHashMap<String,URL>sites;//nomeseURLsdesiteprivateArrayList<String>siteNames;//nomesdesitesprivateJListsiteChooser;//...
asked by 22.08.2014 / 01:28
1
answer

Non-static variable can not be referenced from non-static context

I'm using a context where I have a variable of type array with reference to another class. When trying to declare the object-instantiated class and declare its size this error is returned and I would like to understand why:    non-static vari...
asked by 09.09.2014 / 03:19
1
answer

Java interface layout

I'm developing a program for a friend and I'm using the Java language for this. I'm using the Netbeans IDE which has the feature of building the user interface (UI) by drag n 'drop, using Swing. I have a lot of trouble building UI, I'm pretty...
asked by 14.10.2014 / 21:36
1
answer

How to capture only the first part of a text that fits the regex?

<END>Av. Dr. Walter Belian, nº 2.230, Distrito Industrial, João Pessoa-PB, com CNPJ nº 07.526.557/0013-43 e Inscrição Estadual nº 16.218.7157; (NR) II - Sergipe, localizada na Rodovia BR-101, s/nº, km 133, Distrito Industrial, Estância-SE,...
asked by 22.01.2017 / 03:06
1
answer

Java Dictionary API

Hello, I'm looking for an API, from a dictionary, in Java to create the program in the following steps: User enters a string, in this case a word; Print on the screen invoking a method of this API; Which will return a sentence, with the...
asked by 25.07.2015 / 17:44
1
answer

Error "The resultSet is closed" with PreparedStatement

I'm getting this when I'm traversing a ResultSet and get other ResultSet s: public class BpaDetDao extends DaoAbstract<BpaDetBean> { public static final String // TODO Colocar campos no select SQL_SELECT =...
asked by 29.06.2015 / 22:20
1
answer

"illegal start of expression" error

In my main I'm calling the stats method: user.stats(ctr); The method stats itself: public void stats (int num) { int i; float total=0, perc; for (i=0;i<num;i++) { total = total + sensors[i]....
asked by 11.07.2015 / 14:43
1
answer

Because the compiler warns me Anonymous new Runnable () can be replaced with lambda

Because this code ( Thread ) shows this message ( in the compiler ), and how do you not show it again? Code: public void onCreate(Bundle icicle) { ... mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {...
asked by 03.07.2015 / 01:46