Click here to Skip to main content
15,879,535 members
Home / Discussions / Java
   

Java

 
GeneralRe: Help with a website written in Java Pin
Gerry Schmitz28-Nov-19 5:37
mveGerry Schmitz28-Nov-19 5:37 
QuestionHelp With Sorting Multidimensional String Array Pin
eskomo8424-Nov-19 6:15
eskomo8424-Nov-19 6:15 
AnswerRe: Help With Sorting Multidimensional String Array Pin
Richard MacCutchan24-Nov-19 6:23
mveRichard MacCutchan24-Nov-19 6:23 
GeneralRe: Help With Sorting Multidimensional String Array Pin
eskomo8424-Nov-19 6:45
eskomo8424-Nov-19 6:45 
GeneralRe: Help With Sorting Multidimensional String Array Pin
Richard MacCutchan24-Nov-19 6:52
mveRichard MacCutchan24-Nov-19 6:52 
GeneralRe: Help With Sorting Multidimensional String Array Pin
eskomo8424-Nov-19 9:09
eskomo8424-Nov-19 9:09 
GeneralRe: Help With Sorting Multidimensional String Array Pin
Richard MacCutchan24-Nov-19 23:14
mveRichard MacCutchan24-Nov-19 23:14 
QuestionJavaFX Background not beeing used on a ScrollPane element [Solved] Pin
Valentinor24-Nov-19 4:48
Valentinor24-Nov-19 4: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 6:40
Valentinor27-Nov-19 6:40 
Question!!Please Help!! Student Needs Help It Shows me exercise/ wrong catagory moved to web dev JS Pin
Member 1465076510-Nov-19 6:04
Member 1465076510-Nov-19 6: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 6:24
mveRichard MacCutchan10-Nov-19 6: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 11:15
Member 1465076510-Nov-19 11: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 12:03
Member 1465076510-Nov-19 12:03 
QuestionGlobal Histogram Implementation in Java Pin
Member 146130164-Oct-19 11:37
Member 146130164-Oct-19 11:37 
AnswerRe: Global Histogram Implementation in Java Pin
phil.o4-Oct-19 22:06
professionalphil.o4-Oct-19 22:06 
QuestionBiometric attendace machine data Pin
Member 146125164-Oct-19 1:15
Member 146125164-Oct-19 1:15 
AnswerRe: Biometric attendace machine data Pin
Richard MacCutchan4-Oct-19 3:19
mveRichard MacCutchan4-Oct-19 3:19 
AnswerRe: Biometric attendace machine data Pin
Gerry Schmitz4-Oct-19 6:35
mveGerry Schmitz4-Oct-19 6:35 
QuestionNeed to develop a program on Java for desktop Pin
Ryder Weber1-Oct-19 3:32
Ryder Weber1-Oct-19 3:32 
AnswerRe: Need to develop a program on Java for desktop Pin
Richard MacCutchan1-Oct-19 4:13
mveRichard MacCutchan1-Oct-19 4:13 
AnswerRe: Need to develop a program on Java for desktop Pin
Gerry Schmitz4-Oct-19 20:35
mveGerry Schmitz4-Oct-19 20:35 
Questionhow to reuse open browser in java selenium? Pin
nadavrock29-Sep-19 19:23
nadavrock29-Sep-19 19:23 
AnswerRe: how to reuse open browser in java selenium? Pin
Leanbridge Technologies1-Nov-19 23:07
professionalLeanbridge Technologies1-Nov-19 23:07 
QuestionJava Cant pass the value that user input as the string and view it Pin
raigen27-Sep-19 5:44
raigen27-Sep-19 5:44 
AnswerRe: Java Cant pass the value that user input as the string and view it Pin
Richard MacCutchan27-Sep-19 6:56
mveRichard MacCutchan27-Sep-19 6: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.