title: How to set size of JTextField in pixels
body: <p>Hey I was just wondering if there is a way to set JTextField width for example 50% of the screen size. I know how to get the dimensions of screen just JTextField sets it to number of characters not pixels</p>
  
  <p>textfield = new JTextField("Way hello there", 20);</p>
  
  <p>is there a way to do this ?</p>