a TextField with awt in a java applet exported from Processing renders black in the browser -
the web-applet building interactive 3d display of architectural 3d model buttons , text input fields overlaid on allow users login. when awt textfield used in processing sketch displays , runs correctly when run processing ide when sketch exported applet , loaded through browser texfields render solid black.
the applet can seen in action on video - https://vimeo.com/68475579 , in reality can experience problem here when trying login or create new user - http://www.boxinacloud.com/biac/
in general there few libraries gui in processing such controlp5 , have tried using of them before resorting awt's textfield. reason is: controlp5 has same problem ui components - render black in browser. other libraries (g4p, interfascia, etc.) either don't have version processing 1.51 or don't offer textfield class or have issues displaying text in legible graphics - because of p3d display mode used in case.
unfortunately processing 1.5.1 must used instead of latest 2.0. because peasycam library , other specifics code has been written far not compatible processing 2.0.
i open suggestions other textfield classes or hints might cause problem of textfield built in awt render black.
below code used generate textfields awt
import java.awt.*; /// textfields panel dummypanel = new panel(); // voodoo // panel usernamepanel = new panel(); // holder input field textfield usernamefield = new textfield(""); // panel passwordpanel = new panel(); // holder input field textfield passwordfield = new textfield(""); // panel password2panel = new panel(); // holder input field textfield password2field = new textfield(""); // panel emailpanel = new panel(); // holder input field textfield emailfield = new textfield(""); // give containers layout setlayout(new borderlayout()); // main container (window?) usernamepanel.setlayout(new borderlayout()); passwordpanel.setlayout(new borderlayout()); password2panel.setlayout(new borderlayout()); emailpanel.setlayout(new borderlayout()); // add containers main container // can set bounds of text fields // left, top, width, height int bordersize = 100; // calculating size of fields int inputheight = 20; // height of input field usernamepanel.setbounds(618, 85, 1000-618-15, inputheight); passwordpanel.setbounds(618, 135, 1000-618-15, inputheight); password2panel.setbounds(618, 185, 1000-618-15, inputheight); emailpanel.setbounds(618, 235, 1000-618-15, inputheight); // usernamepanel.setbackground(new color(128, 128, 128, 0)); passwordpanel.setbackground(new color(128, 128, 128, 0)); password2panel.setbackground(new color(128, 128, 128, 0)); emailpanel.setbackground(new color(128, 128, 128, 0)); // don't know why works does. // dummy held main container , doesn't contain // yet without it, input field inexplicably expands contain output field // (try commenting out). // needs placed in center. dummypanel.setbackground(new color(128, 128, 128, 0)); add(dummypanel, borderlayout.center); passwordfield.setechochar('*'); password2field.setechochar('*'); // add(usernamepanel); add(passwordpanel); add(password2panel); add(emailpanel); usernamepanel.add(usernamefield); passwordpanel.add(passwordfield); password2panel.add(password2field); emailpanel.add(emailfield);
Comments
Post a Comment