Questions tagged as 'java'

4
answers

how to know if a device has a camera with flash?

Hi, I am programming in android studio and I need to know how to detect if an android device has a camera with flash and then launch a Toast informing if it has a camera or not with flash.     
asked by 14.12.2017 / 16:46
1
answer

Change Image Background of the Android System

What I am trying to do is to have an application where there is a button, when I press the button I want to change the Background image of the Android system . I want to change this image: I have researched how I can do this, but th...
asked by 25.12.2017 / 16:34
1
answer

Doubt about MVC + DAO in JAVA

Good morning, I wanted to ask about how "Compulsory" it is to use a controller for each view and NOT a controller for all views. My problem is that I was doing a practice where they asked us to implement the MVC + DAO design patterns in Jav...
asked by 27.11.2018 / 19:49
2
answers

Use data from another class

I have this method: public String comprovarLogin(String usuari, String contrasenya){ final String metode = "comprovarLogin"; String ret = null; try{ //Preparem els arguments del mètode compovarLogin Ma...
asked by 16.11.2018 / 16:33
1
answer

Add two hours in Java

I'm using java and I have the following scenario. The entity season one of the attributes is duration and a season can have many chapters, for each chapter that is added to a season, the duration of all the chapters is added and added to the...
asked by 07.11.2018 / 20:30
2
answers

Doubt with constructor when creating a JFrame. Java

I have a question at the time of being able to use the methods from a class that inherits from JFrame, like this: class MarcoLibre extends JFrame{ } In the constructor, I can access the methods that inherit from JFrame (and their correspon...
asked by 13.07.2018 / 19:38
3
answers

How to print class data?

In the method queueAnalysis , when I send to print System.out.println("Original: " + queue + "\n"); , System.out.println("colados: " + names + "\n"); and          System.out.println("Cola final: " +queue); , gives me as...
asked by 21.09.2017 / 17:53
1
answer

Make another of another kind by its constructor, error

Good morning, today I am trying to make a program which consists in entering the name of the participants of an athletics race, entering their departure time and their arrival time. Previously in class we had made a program that has the Time...
asked by 25.09.2017 / 16:43
4
answers

How to remove the first and last repeated string of zeros from a String

I need to be able to eliminate the first and also the last sequence of repeated zeros of a String in Java For example I have the following String 00000000110110110011100000 And I need to transform it to 1101101100111     
asked by 05.09.2017 / 06:27
2
answers

Convert String to matrix

I have this string in Java String str = "a, b, c, d, e, f, g, h, i, j, k, l, m, , n, o, p"; And I need to convert it into a matrix where the rows and columns are specified. That is: 3 by 3 a b c d e f g h i O 2 for 8 a b...
asked by 01.04.2018 / 08:24