ghasisin,
Following Robert's configuration is like configuring router-on-a-stick in the Cisco world. It will work for the purposes you explained, however you could also configure the SRX in the way you explained. In that case you need to configure the following:
1. Configure the vlans on the SRX
set vlans VLAN-10 vlan-id 10
set vlans VLAN-20 vlan-id 20
2. Create Layer 3 interfaces for those vlans
set interfaces vlan.10 family inet address 192.168.10.1/24
set interfaces vlan.20 family inet address 192.168.20.1/24
3. Link the L3 interfaces to the vlans
set vlans VLAN-10 l3-interface vlan.10
set vlans VLAN-20 l3-interface vlan.20
3. Configure the Trunk port towards the SRX:
set interfaces fe-0/0/0 unit 0 family ethernet-switching port-mode trunk vlan members [ VLAN-10 VLAN-20 ] }