JavaFx - write in a console [duplicate]












0















This question already has an answer here:




  • Appending text into TextArea

    2 answers



  • How to display text on several lines in TextArea

    1 answer




I would like to write sth in a console. I'd like to programm it in JavaFX. I have a problem, because whenever for loop 'make a step', the textarea is cleared. How can I improved it? This is my setonaction method



min.setOnAction(new EventHandler<ActionEvent>() {

@Override
public void handle(ActionEvent event) {
DataFrame df = d.groupby("id").min();
for (String col : df.colNames) {
wynikTextArea.setText(col + " || ");
}

wynikTextArea.setText("n");

for (int i = 0; i < df.get(df.colNames[0]).size(); i++) {
for (int j = 0; j < df.colNames.length; j++) {

ArrayList<Value> databaseRow = df.get(df.colNames[j]);
Value obj = databaseRow.get(i);
String o = obj.toString();
Class<? extends Value> dataType = df.colType.get(df.colNames[j]);

wynikTextArea.setText(o + " || ");
}
wynikTextArea.setText("n");

}
}
});


actionStatus = new Text();
VBox vbox = new VBox(30);
Label wynikLabel = new Label("Wynik:");
// Dodajemy ją do VBox-u
vbox.getChildren().add(wynikLabel);
// Tworzymy TextArea do wypisywania wyniku
TextArea wynikTextArea = new TextArea();
// Wyłączamy możliwość edycji
wynikTextArea.setEditable(false);
// Włączamy zawijanie tekstu
wynikTextArea.setWrapText(true);
// Dodajemy do VBox-u
vbox.getChildren().add(wynikTextArea);









share|improve this question













marked as duplicate by fabian java
Users with the  java badge can single-handedly close java questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 22 at 21:29


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • why use setText instead of apendText ?
    – charles Lgn
    Nov 23 at 9:25
















0















This question already has an answer here:




  • Appending text into TextArea

    2 answers



  • How to display text on several lines in TextArea

    1 answer




I would like to write sth in a console. I'd like to programm it in JavaFX. I have a problem, because whenever for loop 'make a step', the textarea is cleared. How can I improved it? This is my setonaction method



min.setOnAction(new EventHandler<ActionEvent>() {

@Override
public void handle(ActionEvent event) {
DataFrame df = d.groupby("id").min();
for (String col : df.colNames) {
wynikTextArea.setText(col + " || ");
}

wynikTextArea.setText("n");

for (int i = 0; i < df.get(df.colNames[0]).size(); i++) {
for (int j = 0; j < df.colNames.length; j++) {

ArrayList<Value> databaseRow = df.get(df.colNames[j]);
Value obj = databaseRow.get(i);
String o = obj.toString();
Class<? extends Value> dataType = df.colType.get(df.colNames[j]);

wynikTextArea.setText(o + " || ");
}
wynikTextArea.setText("n");

}
}
});


actionStatus = new Text();
VBox vbox = new VBox(30);
Label wynikLabel = new Label("Wynik:");
// Dodajemy ją do VBox-u
vbox.getChildren().add(wynikLabel);
// Tworzymy TextArea do wypisywania wyniku
TextArea wynikTextArea = new TextArea();
// Wyłączamy możliwość edycji
wynikTextArea.setEditable(false);
// Włączamy zawijanie tekstu
wynikTextArea.setWrapText(true);
// Dodajemy do VBox-u
vbox.getChildren().add(wynikTextArea);









share|improve this question













marked as duplicate by fabian java
Users with the  java badge can single-handedly close java questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 22 at 21:29


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • why use setText instead of apendText ?
    – charles Lgn
    Nov 23 at 9:25














0












0








0








This question already has an answer here:




  • Appending text into TextArea

    2 answers



  • How to display text on several lines in TextArea

    1 answer




I would like to write sth in a console. I'd like to programm it in JavaFX. I have a problem, because whenever for loop 'make a step', the textarea is cleared. How can I improved it? This is my setonaction method



min.setOnAction(new EventHandler<ActionEvent>() {

@Override
public void handle(ActionEvent event) {
DataFrame df = d.groupby("id").min();
for (String col : df.colNames) {
wynikTextArea.setText(col + " || ");
}

wynikTextArea.setText("n");

for (int i = 0; i < df.get(df.colNames[0]).size(); i++) {
for (int j = 0; j < df.colNames.length; j++) {

ArrayList<Value> databaseRow = df.get(df.colNames[j]);
Value obj = databaseRow.get(i);
String o = obj.toString();
Class<? extends Value> dataType = df.colType.get(df.colNames[j]);

wynikTextArea.setText(o + " || ");
}
wynikTextArea.setText("n");

}
}
});


actionStatus = new Text();
VBox vbox = new VBox(30);
Label wynikLabel = new Label("Wynik:");
// Dodajemy ją do VBox-u
vbox.getChildren().add(wynikLabel);
// Tworzymy TextArea do wypisywania wyniku
TextArea wynikTextArea = new TextArea();
// Wyłączamy możliwość edycji
wynikTextArea.setEditable(false);
// Włączamy zawijanie tekstu
wynikTextArea.setWrapText(true);
// Dodajemy do VBox-u
vbox.getChildren().add(wynikTextArea);









share|improve this question














This question already has an answer here:




  • Appending text into TextArea

    2 answers



  • How to display text on several lines in TextArea

    1 answer




I would like to write sth in a console. I'd like to programm it in JavaFX. I have a problem, because whenever for loop 'make a step', the textarea is cleared. How can I improved it? This is my setonaction method



min.setOnAction(new EventHandler<ActionEvent>() {

@Override
public void handle(ActionEvent event) {
DataFrame df = d.groupby("id").min();
for (String col : df.colNames) {
wynikTextArea.setText(col + " || ");
}

wynikTextArea.setText("n");

for (int i = 0; i < df.get(df.colNames[0]).size(); i++) {
for (int j = 0; j < df.colNames.length; j++) {

ArrayList<Value> databaseRow = df.get(df.colNames[j]);
Value obj = databaseRow.get(i);
String o = obj.toString();
Class<? extends Value> dataType = df.colType.get(df.colNames[j]);

wynikTextArea.setText(o + " || ");
}
wynikTextArea.setText("n");

}
}
});


actionStatus = new Text();
VBox vbox = new VBox(30);
Label wynikLabel = new Label("Wynik:");
// Dodajemy ją do VBox-u
vbox.getChildren().add(wynikLabel);
// Tworzymy TextArea do wypisywania wyniku
TextArea wynikTextArea = new TextArea();
// Wyłączamy możliwość edycji
wynikTextArea.setEditable(false);
// Włączamy zawijanie tekstu
wynikTextArea.setWrapText(true);
// Dodajemy do VBox-u
vbox.getChildren().add(wynikTextArea);




This question already has an answer here:




  • Appending text into TextArea

    2 answers



  • How to display text on several lines in TextArea

    1 answer








java javafx console textarea settext






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 22 at 21:12









Claudia Lovin

83




83




marked as duplicate by fabian java
Users with the  java badge can single-handedly close java questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 22 at 21:29


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by fabian java
Users with the  java badge can single-handedly close java questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 22 at 21:29


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • why use setText instead of apendText ?
    – charles Lgn
    Nov 23 at 9:25


















  • why use setText instead of apendText ?
    – charles Lgn
    Nov 23 at 9:25
















why use setText instead of apendText ?
– charles Lgn
Nov 23 at 9:25




why use setText instead of apendText ?
– charles Lgn
Nov 23 at 9:25

















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Trompette piccolo

Slow SSRS Report in dynamic grouping and multiple parameters

Simon Yates (cyclisme)