Note that there are some explanatory texts on larger screens.

plurals
  1. POMistake in JFrame
    text
    copied!<p>I'm doing a project but I have a little problem with a Frame, I have a problem with a table.</p> <p>Well, I have this:</p> <p><img src="https://i.stack.imgur.com/gVVyh.png" alt="My frame"></p> <p>The source that have for the previous picture is:</p> <pre><code>public class Geotools04 extends JFrame { private JMapFrame mapFrame; static StyleFactory styleFactory = CommonFactoryFinder.getStyleFactory(null); static FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(null); Geotools04(File[] files) throws IOException, CQLException { FileDataStore store = FileDataStoreFinder.getDataStore(files[0]); SimpleFeatureSource featureSource = store.getFeatureSource(); Filter filter = CQL.toFilter("MAN_COD = '01'"); SimpleFeatureCollection features = featureSource.getFeatures(filter); FeatureCollectionTableModel model = new FeatureCollectionTableModel(features); for(int i=0;i&lt;model.getColumnCount();i++){ System.out.println(model.getColumnName(i)); } JFrame frame = new JFrame(); JTable table = new JTable(); frame.setLayout(new GridLayout(6, 2)) ; JLabel a = new JLabel("Capas existentes:"); JComboBox layer = new JComboBox(); for(int i=0; i &lt; files.length ; i++){ layer.addItem(files[i].getName()); } JLabel c = new JLabel("Atributos de capa:"); JComboBox d = new JComboBox(); d.addItem ("MAN_COD"); JCheckBox e = new JCheckBox("Where"); JTextField f = new JTextField("= '01'"); JCheckBox g = new JCheckBox("Where igual"); JTextField h = new JTextField("01"); h.setEditable(false); JCheckBox i = new JCheckBox("Todos los registros"); JButton j = new JButton("Consultar"); frame.add(a); frame.add(layer); frame.add(c); frame.add(d); frame.add(e); frame.add(f); frame.add(g); frame.add(h); frame.add(i); frame.add(j); table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); table.setModel(new DefaultTableModel(5, 5)); table.setPreferredScrollableViewportSize(new Dimension(500, 200)); JScrollPane scrollPane = new JScrollPane(table); table.setModel(model); frame.add(scrollPane); frame.setSize(600, 600); frame.setVisible(true); } } </code></pre> <p>But I need that my frame look like this:</p> <p><img src="https://i.stack.imgur.com/MC67c.png" alt="my goal"></p> <p>So, can you help me, I put all in a GridLayout but I need that the last table be bigger... But I don't know how to organize the element for put in the way that I want to...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload