In the diagram, what is the value of $x?$ [asy]
size(150);
draw((0,5)--(0,0)--(5,0));
draw((0,0)--(3,5));
draw((0,.3)--(.3,.3)--(.3,0));
label("$2x^\circ$",(.5,2));
label("$3x^\circ$",(1,.6));
[/asy]
The angles $2x^{\circ}$ and $3x^{\circ}$ shown are complementary and thus add to $90^{\circ}.$ Therefore, $2x+3x=90$ or $5x=90$ and so $x=\frac{90}{5}=\boxed{18}.$