Click here to Skip to main content
15,843,498 members
Home / Discussions / Java
   

Java

 
GeneralRe: Help with a website written in Java Pin
Gerry Schmitz28-Nov-19 6:37
mveGerry Schmitz28-Nov-19 6:37 
QuestionHelp With Sorting Multidimensional String Array Pin
eskomo8424-Nov-19 7:15
eskomo8424-Nov-19 7:15 
AnswerRe: Help With Sorting Multidimensional String Array Pin
Richard MacCutchan24-Nov-19 7:23
mveRichard MacCutchan24-Nov-19 7:23 
GeneralRe: Help With Sorting Multidimensional String Array Pin
eskomo8424-Nov-19 7:45
eskomo8424-Nov-19 7:45 
GeneralRe: Help With Sorting Multidimensional String Array Pin
Richard MacCutchan24-Nov-19 7:52
mveRichard MacCutchan24-Nov-19 7:52 
GeneralRe: Help With Sorting Multidimensional String Array Pin
eskomo8424-Nov-19 10:09
eskomo8424-Nov-19 10:09 
GeneralRe: Help With Sorting Multidimensional String Array Pin
Richard MacCutchan25-Nov-19 0:14
mveRichard MacCutchan25-Nov-19 0:14 
QuestionJavaFX Background not beeing used on a ScrollPane element [Solved] Pin
Valentinor24-Nov-19 5:48
Valentinor24-Nov-19 5:48 
In the following example the setBackground() for the TextField element won't work if it is in a Pane inside a ScrollPane which has the style "-fx-background: transparent;" added, but the problem is that I need it, in order to make the ScrollPane transparent. The weird part is that setBackground() works just fine for the Label element I used in this example. I can not use a CSS file in my original project.
Is this a bug or is there a walk-around for this problem?

To test it, just change the following line
Scene scene = new Scene(scroll);

in this:
Scene scene = new Scene(pane);

public class TestingTextFieldBackground extends Application {

	public static void main(String[] args) {
		launch(args);
	}

	@Override
	public void start(Stage primaryStage) throws Exception {
		Pane pane = new AnchorPane();
		pane.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT, CornerRadii.EMPTY, Insets.EMPTY)));
		pane.setPrefWidth(500);
		pane.setPrefHeight(500);
		pane.setLayoutX(0);
		pane.setLayoutY(0);

		ScrollPane scroll = new ScrollPane();
		scroll.setContent(pane);
		scroll.setLayoutX(0);
		scroll.setLayoutY(100);
		scroll.setPrefWidth(500);
		scroll.setPrefHeight(400);
		scroll.setHbarPolicy(ScrollBarPolicy.NEVER);
		scroll.setVbarPolicy(ScrollBarPolicy.ALWAYS);
		scroll.setStyle(
				"-fx-background: transparent; -fx-background-color: transparent; -fx-padding: 0; -fx-background-insets: 0;");

		Scene scene = new Scene(scroll);
		scene.setFill(Color.TRANSPARENT);

		Stage stage = new Stage();
		stage.setWidth(500);
		stage.setHeight(500);
		stage.initStyle(StageStyle.TRANSPARENT);
		stage.setScene(scene);

		Label label = new Label("Bellow you'll find our clients data. (This text is used just as an example)");
		label.setLayoutX(0);
		label.setLayoutY(0);
		label.setTextFill(Color.YELLOW);
		// This will work fine even if ScrollPane is used.
		label.setBackground(new Background(new BackgroundFill(Color.BLACK, CornerRadii.EMPTY, Insets.EMPTY)));
		pane.getChildren().add(label);

		int up = 100;
		for (int i = 0; i < 50; i++) {
			TextField text = new TextField("Client with ID: " + i + ", has " + up + " dollars in account.");
			text.setLayoutX(0);
			text.setLayoutY(up);
			text.setPrefWidth(450);
			// The problem is here.
			text.setBackground(new Background(new BackgroundFill(Color.DARKRED, CornerRadii.EMPTY, Insets.EMPTY)));
			pane.getChildren().add(text);
			up += 80;
		}

		stage.centerOnScreen();
		stage.show();
	}
}


modified 27-Nov-19 12:40pm.

AnswerSolution Pin
Valentinor27-Nov-19 7:40
Valentinor27-Nov-19 7:40 
Question!!Please Help!! Student Needs Help It Shows me exercise/ wrong catagory moved to web dev JS Pin
Member 1465076510-Nov-19 7:04
Member 1465076510-Nov-19 7:04 
QuestionRe: !!Please Help!! Student Needs Help It Shows me exercise 2 is correct but exercise 1 is not defined Pin
Richard MacCutchan10-Nov-19 7:24
mveRichard MacCutchan10-Nov-19 7:24 
AnswerRe: !!Please Help!! Student Needs Help It Shows me exercise 2 is correct but exercise 1 is not defined Pin
Member 1465076510-Nov-19 12:15
Member 1465076510-Nov-19 12:15 
AnswerRe: !!Please Help!! Student Needs Help It Shows me exercise 2 is correct but exercise 1 is not defined Pin
Member 1465076510-Nov-19 13:03
Member 1465076510-Nov-19 13:03 
QuestionGlobal Histogram Implementation in Java Pin
Member 146130164-Oct-19 12:37
Member 146130164-Oct-19 12:37 
AnswerRe: Global Histogram Implementation in Java Pin
phil.o4-Oct-19 23:06
professionalphil.o4-Oct-19 23:06 
QuestionBiometric attendace machine data Pin
Member 146125164-Oct-19 2:15
Member 146125164-Oct-19 2:15 
AnswerRe: Biometric attendace machine data Pin
Richard MacCutchan4-Oct-19 4:19
mveRichard MacCutchan4-Oct-19 4:19 
AnswerRe: Biometric attendace machine data Pin
Gerry Schmitz4-Oct-19 7:35
mveGerry Schmitz4-Oct-19 7:35 
QuestionNeed to develop a program on Java for desktop Pin
Ryder Weber1-Oct-19 4:32
Ryder Weber1-Oct-19 4:32 
AnswerRe: Need to develop a program on Java for desktop Pin
Richard MacCutchan1-Oct-19 5:13
mveRichard MacCutchan1-Oct-19 5:13 
AnswerRe: Need to develop a program on Java for desktop Pin
Gerry Schmitz4-Oct-19 21:35
mveGerry Schmitz4-Oct-19 21:35 
Questionhow to reuse open browser in java selenium? Pin
nadavrock29-Sep-19 20:23
nadavrock29-Sep-19 20:23 
AnswerRe: how to reuse open browser in java selenium? Pin
Leanbridge Technologies2-Nov-19 0:07
professionalLeanbridge Technologies2-Nov-19 0:07 
QuestionJava Cant pass the value that user input as the string and view it Pin
raigen27-Sep-19 6:44
raigen27-Sep-19 6:44 
AnswerRe: Java Cant pass the value that user input as the string and view it Pin
Richard MacCutchan27-Sep-19 7:56
mveRichard MacCutchan27-Sep-19 7:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.