Questions tagged as 'java'

1
answer

How to create a pair of values within a Map in Java

Is it possible to create a Map in Java using the concept of pair that exists in C ++? I have tried using the form below, however, I can not assign values to my map. Map<String, Entry<Entry<Integer,Integer>,String>...
asked by 04.04.2015 / 21:46
2
answers

How to retrieve a string-array item within the layout of my activity, in the "xml" case?

I created an array of strings in xml in my folder strings.xml, now I want to know how to retrieve a specific item according to its position, both in the Java source itself and in the XML code ... code in the strings folder: <string-array...
asked by 11.04.2015 / 14:09
1
answer

When concatenating String add an ENTER

When I concatenate (+) strings it adds only a enter shortly after the concatenation. private static Dimension TOOLKIT = Toolkit.getDefaultToolkit().getScreenSize(); private static GraphicsEnvironment GE = GraphicsEnvironment.getLocalGr...
asked by 06.08.2015 / 20:19
1
answer

Create document templates in Java

I'm creating a Java system with Swing, where I would have document templates, and would populate with user-entered data in a form I've already created, so that it generates a template PDF filled with the data. I tried to do it in a "raw" way,...
asked by 31.07.2015 / 20:31
1
answer

GlassFish does not get root context of the application

EDIT Galera I got to solve, I was missing pointing my application to my virtual server, thank you. I uploaded an application on the server today and glassFish is not picking up the application context alone for example to access I'm having...
asked by 29.01.2015 / 14:28
1
answer

Error using required inputs on Primefaces

I have some Primefaces inputs inside a Wizard , showing just one of them: <p:inputText id="inputTitulo" value="#{editalBean.edital.titulo}" required="true" requiredMessage="Informe um título" label="titulo" /> It happens...
asked by 08.02.2015 / 19:43
1
answer

How to use the servlet context listener to start a servlet as soon as the application loads?

I have the following servlet declared in web.xml and would like it to be initialized before any of the other servlets of the application: <servlet> <servlet-name>ListarFilmesIndex</servlet-name> <servlet-class>b...
asked by 02.11.2015 / 10:41
1
answer

Placing click event on the button that is in a Fragment, in an Activity?

I want to put a setOnClickListener on the button that is in a fragment, through my activity. Here are the codes: Activity: private Button mButtonCriarConta; // onCreate da Activity... mButtonCriarConta = (Button) findViewById(R.id.emai...
asked by 10.11.2015 / 16:07
1
answer

Change the color of a jProgressBar

How can I change the color of my ProgressBar, it always looks an odd little orange, I tried to use this code but it did not work: UIManager.put("ProgressBar.background", Color.orange); UIManager.put("ProgressBar.foreground", Color.blue); UIMan...
asked by 22.04.2015 / 19:05
1
answer

How to leave space between images?

I have this layout: telainicial.xml<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:o...
asked by 16.04.2015 / 21:47