Skip to main content

Password TextField

8 replies [Last post]
leonardoreyes
Offline
Joined: 2007-09-25

Hello, i have a question,
How can i use a password textfield in the preview-sdk?
i've been looking for it, but i can't find it.

can someone help me?

Message was edited by: leonardoreyes

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jaydfwtx
Offline
Joined: 2006-05-30

I'm not seeing it either, but supposedly you can do something like this:

[code]
JPasswordField jp = new JPasswordField()
var p = Component.fromJComponent(jp)
[/code]

Message was edited by: jaydfwtx

leonardoreyes
Offline
Joined: 2007-09-25

Thanks i'm going to test it.

riepi
Offline
Joined: 2008-03-27

Hi, did you test it? I need this, too. But i don't know how to integrate this into my code. Always an error occurs.

leonardoreyes
Offline
Joined: 2007-09-25

I test it, but i couldn't put it into a Frame or SwingFrame. But i did this and it worked:

[code]
public class TPasswordField extends Component{
public attribute columns: Integer = getTPasswordField().getColumns() on replace {
doAndIgnoreJComponentChange(function() {
getTPasswordField().setColumns(columns);
});
}

public /* final */ function getTPasswordField(): JPasswordField {
getJComponent() as JPasswordField;
}

public function createJComponent(): JComponent {
new JPasswordField();
}
}
[/code]

i see how SwingTextField it's coded in the source code of the compiler and write only that. And i have to add more attributes, like text,

This is how i put it in the Frame:

[code]Frame{
title: "Pruebas", width: 800, height: 600, visible: true
resizable: false
stage: Stage {
content: [
ComponentView {
transform: [ ]
component: TPasswordField {
columns: 18
}
}
]
}
}[/code]

Message was edited by: leonardoreyes

Message was edited by: leonardoreyes

riepi
Offline
Joined: 2008-03-27

i will try this out, thanks.

riepi
Offline
Joined: 2008-03-27

can you tell me where i can find how other Components are coded in the Compiler. U mentioned SwingTextField. I can't find.

leonardoreyes
Offline
Joined: 2007-09-25

i enter in the openjfx-compiler project in the subversion menu this it's the link
https://openjfx-compiler.dev.java.net/source/browse/openjfx-compiler/

and this is where i see the code:
https://openjfx-compiler.dev.java.net/source/browse/openjfx-compiler/tru...

Message was edited by: leonardoreyes

riepi
Offline
Joined: 2008-03-27

thanks