swing - borders in java -


i want set single title border group of textfields how can in java / swing.

i have tried below code text fields compressing inside panel

// create panel , add components it. jpanel pnl = new jpanel(new flowlayout(flowlayout.left));  pnl.add(new jlabel("name")); pnl.add(new jtextfield());  // add titled border panel, therefore surround // child components placed on panel. pnl.setborder(borderfactory.createtitledborder("it's friday!")); 

here's example using swing:

// create panel , add components it. jpanel pnl = new jpanel(new flowlayout(flowlayout.left));  pnl.add(new jlabel("name")); pnl.add(new jtextfield());  // add titled border panel, therefore surround // child components placed on panel. pnl.setborder(borderfactory.createtitledborder("it's friday!")); 

Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -