I have a second window that I am using to hold a textfield.
The text typed in the text fiels is about a 10 sized font but it would be great if it was about 28 sized and bold...
Is this possible???
I tried setting
G4P.setFont(this, "Arial", 24);
in setup()
but it caused errors.
heres the code
(main sketch):
- // Need G4P library
import g4p_controls.*;
int a=1;
String sentense; - public void setup(){
size(800, 200, JAVA2D);
createGUI();
customGUI();
} - public void draw(){
background(230); - }
- // Use this method to add additional statements
// to customise the GUI controls
public void customGUI(){ - }
(gui sketch):
- public void button1_click1(GButton source, GEvent event) { //_CODE_:button1:971405:
if (a==1){
window1.close();
a=0;
}else{a=1;
window1 = new GWindow(this, "Window title", 0, 0, 1800, 100, false, JAVA2D);
window1.setActionOnClose(G4P.CLOSE_WINDOW);
window1.addDrawHandler(this, "win_draw2");
txf1 = new GTextField(window1.papplet, 0, 0, 1800, 100, G4P.SCROLLBARS_NONE);
txf1.setOpaque(true);
txf1.addEventHandler(this, "txf1_change1");
}
} //_CODE_:button1:971405: - synchronized public void win_draw2(GWinApplet appc, GWinData data) { //_CODE_:window1:550721:
appc.background(230);
} //_CODE_:window1:550721: - public void txf1_change1(GTextField tc, GEvent event) { //_CODE_:textfield2:640996:
switch(event) { - case ENTERED:
sentense=tc.getText();
System.out.println(sentense);
sentense="";
tc.setText("");
break;
default:
break;
}
} //_CODE_:textfield2:640996: - // Create all the GUI controls.
// autogenerated do not edit
public void createGUI(){
G4P.messagesEnabled(false);
G4P.setGlobalColorScheme(GCScheme.BLUE_SCHEME);
G4P.setCursor(ARROW);
if(frame != null)
frame.setTitle("Sketch Window");
button1 = new GButton(this, 200, 145, 80, 30);
button1.setText("Face text");
button1.addEventHandler(this, "button1_click1");
window1 = new GWindow(this, "Window title", 0, 0, 1800, 100, false, JAVA2D);
window1.setActionOnClose(G4P.CLOSE_WINDOW);
window1.addDrawHandler(this, "win_draw2");
txf1 = new GTextField(window1.papplet, 0, 0, 1800, 100, G4P.SCROLLBARS_NONE);
txf1.setOpaque(true);
txf1.addEventHandler(this, "txf1_change1");
} - // Variable declarations
// autogenerated do not edit
GButton button1;
GWindow window1;
GTextField txf1;
1