Skip to content

Instantly share code, notes, and snippets.

@nugraha16
Created March 14, 2013 04:12
Show Gist options
  • Save nugraha16/5158739 to your computer and use it in GitHub Desktop.
Save nugraha16/5158739 to your computer and use it in GitHub Desktop.
Membuat JTableMakeOver
package newbieilmuDemo;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.border.EmptyBorder;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import com.jtattoo.plaf.acryl.AcrylLookAndFeel;
import javax.swing.JLabel;
import javax.swing.ImageIcon;
import java.awt.Font;
import java.awt.Color;
import javax.swing.JSeparator;
//@Anugrah Bagus S
public class demoJTableMakeOver extends JFrame {
private JPanel contentPane;
private JTable table;
private JTableMakeOver tablemakeover;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
UIManager.setLookAndFeel(new AcrylLookAndFeel());
demoJTableMakeOver frame = new demoJTableMakeOver();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public demoJTableMakeOver() {
setTitle("::demoJTableMakeOver::");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 509, 359);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JScrollPane scrollPane = new JScrollPane();
scrollPane.setBounds(12, 78, 475, 203);
contentPane.add(scrollPane);
table = new JTable();
tablemakeover = new JTableMakeOver();
table.setModel(new DefaultTableModel(
new Object[][] {
{null, null, null, null, null},
{null, null, null, null, null},
{null, null, null, null, null},
{null, null, null, null, null},
{null, null, null, null, null},
},
new String[] {
"IdPelanggan", "NmPelanggan", "Alamat", "NoTelp", "No.HP"
}
));
scrollPane.setViewportView(table);
table.setUI(tablemakeover);
JLabel lblJtablemakeover = new JLabel("JTableMakeOver");
lblJtablemakeover.setForeground(Color.WHITE);
lblJtablemakeover.setFont(new Font("Dialog", Font.PLAIN, 20));
lblJtablemakeover.setBounds(165, 12, 180, 40);
contentPane.add(lblJtablemakeover);
JLabel label = new JLabel("");
label.setForeground(Color.WHITE);
label.setFont(new Font("Dialog", Font.PLAIN, 26));
label.setIcon(new ImageIcon("/home/newbieilmu/workspace/app.newbieilmu/src/image/gradient/bggradient.png"));
label.setBounds(0, 0, 499, 328);
contentPane.add(label);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment