Created
May 13, 2020 21:00
-
-
Save Tajcore/7dbaaf539968cc940cf205361aaf7e8c to your computer and use it in GitHub Desktop.
Search panel not showing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.*; | |
import java.awt.*; | |
public class SNIDGUI { | |
public static void main(String args[]) { | |
JFrame frame = new JFrame("SYSTEM FOR NATIONAL INDENTIFICATION (SNID)"); | |
frame.setSize(600, 800); | |
frame.setBackground(Color.WHITE); | |
JPanel first = new JPanel(); | |
first.setBackground(Color.WHITE); | |
ButtonGroup bGroup = new ButtonGroup(); | |
JRadioButton id = new JRadioButton("Search by id", false); | |
JRadioButton name = new JRadioButton("Seach by Name", false); | |
JRadioButton biosearch = new JRadioButton("Biometric Search", false); | |
id.setBackground(Color.WHITE); | |
name.setBackground(Color.WHITE); | |
biosearch.setBackground(Color.WHITE); | |
bGroup.add(id); | |
bGroup.add(name); | |
bGroup.add(biosearch); | |
first.add(id); | |
first.add(name); | |
first.add(biosearch); | |
frame.add(first, BorderLayout.NORTH); | |
JPanel second = new JPanel(); | |
second.setBackground(Color.WHITE); | |
BoxLayout boxlayout = new BoxLayout(second, BoxLayout.Y_AXIS); | |
second.setLayout(boxlayout); | |
JButton searchButton = new JButton(" Search"); | |
JButton clearButton = new JButton(" Clear "); | |
JButton quitButton = new JButton(" Quit "); | |
second.add(Box.createRigidArea(new Dimension(10, 25))); | |
second.add(searchButton); | |
second.add(Box.createRigidArea(new Dimension(10, 10))); | |
second.add(clearButton); | |
second.add(Box.createRigidArea(new Dimension(10, 10))); | |
second.add(quitButton); | |
frame.add(second, BorderLayout.EAST); | |
JPanel third = new JPanel(); | |
third.setBackground(Color.WHITE); | |
JTextField userent = new JTextField(" User enters search string here "); | |
third.add(userent); | |
frame.add(third); | |
JPanel fourth = new JPanel(); | |
fourth.setBackground(Color.WHITE); | |
JTextArea idRecs = new JTextArea("\n \n Id of located \n records are \n displayed here. \n User can select \n one for \n detailed \n display \n \n"); | |
JTextArea dets = new JTextArea("\n \n \n \n \nDetails of a selected record are displayed here \n \n \n \n \n"); | |
fourth.add(idRecs); | |
fourth.add(dets); | |
frame.add(fourth); | |
frame.pack(); | |
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | |
frame.setVisible(true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment