Questions tagged as 'java'

3
answers

Can switch be used with objects in java?

Hello very afternoon or evening ... my question is the following can you use the switches to compare objects ?? see it this way I have a window with 3 buttons, each button changes the background to a different color could the switch be implement...
asked by 03.02.2018 / 13:45
1
answer

How can I get the contents of an ArrayListString and put them in a constructor?

Good evening, my question is how can I get the data that contains an ArrayList and when I get it I can insert it in a parameterized constructor of 4 parameters that are String, String, String, int ?. The class is Magazine with those 4 parameters...
asked by 20.01.2018 / 21:43
1
answer

Insert DNI instead of email of the current user

I am inserting data in a request table in jsf . Everything is fine except one detail: I want to place the email of the current user where the attribute nombre_empresa is, but instead I put the value of another attribute...
asked by 13.06.2018 / 20:18
1
answer

Get path where the jar file was run

Hello, I am developing an application, which will be executed from a USB, but as the absolute path of a USB can vary depending on the equipment, whether it is in D:\ or F:\ ect, ect. I need to know how to get the location where the...
asked by 15.06.2018 / 04:47
1
answer

Regarding the sentence "compareTo"

I have a question about the compareTo statement. If I have: if(x.compareTo(y)==0) I understand that I am asking if the value of x is equal to and . But if I want to ask if they are different? Should I place a denial forward? if(!(...
asked by 12.06.2018 / 18:06
1
answer

Help with java events

Very good. I have created a fairly simple calculator in Java that works (at the moment) by pressing the buttons on the interface and I have the following questions: For some reason, there are times when pressing the buttons these do not w...
asked by 18.02.2018 / 18:24
1
answer

get the last value of a jtable no matter how many rows have java

I have the question of how to obtain the data of a cell in the last row of a jtable, I used: jTable1.getValueAt(1,0).toString(); but only shows me a specific data, I would like to obtain the last value no matter how many data the jtable has...
asked by 21.02.2018 / 14:35
2
answers

every time I give it to run in eclipse, nothing appears on the console, help

package tarea; public class Trabajador { public static void main(String[] args) { // TODO Auto-generated method stub } private long documento; private String nombre; double valorHora; int horasTrabajo; long salarioTotal; void salaraioTo...
asked by 18.02.2018 / 20:33
1
answer

Help I need to read Java files

Hello! After a long wait at the end, I have to develop a small exercise with Threads. I have a set of txt files with 4 colors in RGB code (red, green, blue), each file contains the rgb colors separated by spaces and the color name: "84 84...
asked by 07.03.2018 / 04:12
1
answer

Intermediate photo in a TextView without cutting the text in two

How can I place text around elements in Android Studio to look like this: Or with the intermediate text without having to chop the text in two like this:     
asked by 11.12.2017 / 17:28