How to get text from EditText?

Well, it depends on your needs. Very often I keep my references to widgets in activity (as a class fields) – and set them in onCreate method. I think that is a good ideaProbably the reason for your nulls is that you are trying to call findViewById() before you set contentView() in your onCreate() method – please check that.

How can I set size of a button?

The following bit of code does what you ask for. Just make sure that you assign enough space so that the text on the button becomes visible The X and Y (two first parameters of the GridLayout constructor) specify the number of rows and columns in the grid (respectively). You may leave one of them … Read more

Use CSS in Java Applications

You should look up javafx. You can attach a css file to a GUI. it is fairly easy to use. I can give you some example code if you want. These are some good tutorials on how to use it: https://www.youtube.com/watch?v=FLkOX4Eez6o I use eclipse to create a css file right click the project -> select … Read more

the getSource() and getActionCommand()

Assuming you are talking about the ActionEvent class, then there is a big difference between the two methods. getActionCommand() gives you a String representing the action command. The value is component specific; for a JButton you have the option to set the value with setActionCommand(String command) but for a JTextField if you don’t set this, … Read more

JavaFX css themes

Guigarage provides 3 out-of-the-box styles. AquaFX, a native look & feel for Mac OSX AeroFX, that gives you the look of a Windows Forms app for Windows 7 Flatter, a flat-design gui theme Feel free to complete this list by answering the question.