- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Samual Sam has Published 2492 Articles
Samual Sam
271 Views
To create a vertical ProgressBar, use the following property −JProgressBar.VERTICALSet it like this −JProgressBar progressBar = new JProgressBar(JProgressBar.VERTICAL, 0, 1000);The following is an example to create a vertical ProgressBar −Examplepackage my; import java.awt.Color; import javax.swing.*; public class SwingDemo extends JFrame { JProgressBar progressBar; int i = 0; ... Read More
Samual Sam
19K+ Views
At first, create a JFrame −JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setPreferredSize(new Dimension(550, 300));Now, change the background color of the JFrame −frame.getContentPane().setBackground(Color.BLUE);The following is an example to change JFrame background color −Exampleimport java.awt.Color; import java.awt.Dimension; import javax.swing.JFrame; public class SwingDemo { public static void main(String[] args) { ... Read More
Samual Sam
11K+ Views
Set frame.dispose() on the click of a button to close JFrame. At first create a button and frame −JFrame frame = new JFrame(); JButton button = new JButton("Click to Close!");Now, close the JFrame on the click of the above button with Action Listener −button.addActionListener(e -> { frame.dispose(); });The following ... Read More
Samual Sam
408 Views
In this problem, one floating point value is given. We have to find number of set bits in the binary representation of it.For example, if a floating point number is 0.15625, so there are six set bits. A typical C compiler used single precision floating point representation. So it will ... Read More
Samual Sam
7K+ Views
Here we will see, one program can be written without main or not? The answer is yes. We can write program, that has no main() function.In many places, we have seen that the main() is the entry point of a program execution. Just from the programmers perspective this is true. ... Read More
Samual Sam
2K+ Views
In C there is no predefined datatype as bool. We can create bool using enum. One enum will be created as bool, then put the false, and true as the element of the enum. The false will be at the first position, so it will hold 0, and true will ... Read More
Samual Sam
123 Views
This is a C++ Program to find k numbers closest to Median of S, where S is a set of n numbers.AlgorithmsBegin function partition() for partitioning the array on the basis of values at high as pivot value: Arguments: a[]=an array. l=low ... Read More
Samual Sam
454 Views
This is a C++ program to find the Mode in a data set.AlgorithmsBegin function insertinset() to insert data in the set. Create newnode and temp(t) node. Node to be inserted in the list using newnode. If head is null then assign new node ... Read More
Samual Sam
90 Views
This is a C++ program to implement the Alexander Bogomolny’s UnOrdered Permutation Algorithm for elements from 1 to NAlgorithmsBegin function AlexanderBogomolny() to implement the Algorithms Arguments: Val[] = an array N = number of elements taken as input. K ... Read More
Samual Sam
425 Views
You can use CURRENT_TIMESTAMP to set system date time. Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, ClientFirstName varchar(20), ClientLastName varchar(20), ClientAge int ); Query OK, 0 rows affected (0.66 sec)Following is the query to set default ... Read More