We investigate the transport properties in T-shaped armchair graphene nanoribbons with a zigzag-edge sidearm connected to two normal-conducting leads. For semiconducting armchair graphene nanoribbons, the conduction peaks can be introduced into the gap regime, which may be used as an energy filter. The metallic armchair graphene nanoribbons with a sidearm are proposed for a field-effect transistor where the on and off states are switched by tuning the length or the width of the sidearm. In addition, we demonstrate that both the on and off states are robust to the tunneling barrier between the leads and the graphene nanoribbons.