Domanda

I want to make a user interface in Java for database modeling, like the image below.

I have made tables but they are not re-sizeable, they only show column using JTable and JFrame. Am I doing right or there any better way to do this?

enter image description here

È stato utile?

Soluzione

It appears that you can nest Swing components inside of a JPanel to create your database table component.

JPanel
    JLabel
    JScrollPane
        JTree
    JScrollPane
        JList

This may or may not be easier than creating a custom Swing component.

You will definitely want to create a GUI model that combines the DefaultMutableTreeNodes of the JTree and the DefaultListModel of the JList.

Altri suggerimenti

You need to make Swing custom component - it's a lot of work.

More information: How to create a custom Swing Component

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top