Galera, não sei ao certo se isso é possível...
Mas eu tenho esse código ai e nele, ele puxa na Form uma stringItem, mas eu não quero puxar uma stringItem, quero puxar a string lerArquivo, como é que eu posso fazer isso??
desde já obrigado a todos
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: constituição ">
/**
* Returns an initiliazed instance of constituição component.
* @return the initialized component instance
*/
public Form getConstituição() {
if (constituição == null) {
// write pre-init user code here
constituição = new Form("Constitui\u00E7\u00E3o Mobile", new Item[] { getStringItem() });
constituição.addCommand(getBackCommand());
constituição.setCommandListener(this);
// write post-init user code here
}
return constituição;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: string ">
/**
* Returns an initiliazed instance of stringItem component.
* @return the initialized component instance
*/
public String lerArquivo(){
try{
int chr = 0;
InputStream arquivo = getClass().getResourceAsStream("constituicao/constituicao.txt");
StringBuffer stb = new StringBuffer();
while ((chr = arquivo.read())!= -1) {
stb.append((char)chr);
}
return stb.toString();
}catch (Exception e){
e.printStackTrace();
}
return null;
}
//</editor-fold>