- 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
Ankith Reddy has Published 1070 Articles
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
247 Views
To create two borders for a single component, use the createCompoundBorder() method in Java. Here, we have created LineBorder nd TitledBorder −LineBorder lineBorder = new LineBorder(Color.red); TitledBorder titleBorder = new TitledBorder("Demo Title"); Border border = BorderFactory.createCompoundBorder(lineBorder, titleBorder);Now, set both the borders for a single component −JButton button = new JButton("two ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
213 Views
To enable scrolling tabs in a JTabbedPane container, use the setTabLayoutPolicy() method −tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);Above, we have set the constant to be SCROLL_TAB_LAYOUT, since we want the scroller to be visible when all the tabs won’t fit within a single run.The following is an example to enable scrolling tabs in a JTabbedPane ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
171 Views
Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Subject varchar(20), Price int ); Query OK, 0 rows affected (0.64 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(Subject, Price) values('MySQL', 456); ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
398 Views
To set the text of the label component to be left-justified and top-aligned, you need to set the alignment. Set the label to be on the left and top aligned −JLabel label = new JLabel("Department”); label.setVerticalAlignment(JLabel.TOP);Here, we have set the size of the label as well as the color that ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
433 Views
Composed border consists of two or more borders i.e. border around a border. We can create it for a component in Java using the createCompoundBorder() method.Let’s say the following is our component −JLabel label; label = new JLabel("This has compound border (border around a border)!");Now, set the compound border −label.setBorder(BorderFactory.createCompoundBorder(BorderFactory ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
253 Views
For this, use the CONCAT() function. Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Subject varchar(200) ); Query OK, 0 rows affected (1.36 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(Subject) ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
68 Views
You can use delete command −delete from yourTableName where yourColumnName='\\';Let us first create a table −mysql> create table DemoTable ( FolderName varchar(100) ); Query OK, 0 rows affected (0.67 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values("????"); Query OK, 1 row ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
532 Views
To remove the first row from a table, use the removeRow() method and set its parameter to 0 since you need to remove the first row i.e. index 0.Let us first see an example to display a table with rows and columns. The table here has 9 rows −Examplepackage my; ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
927 Views
Yes, we can change the default cursor representation in Java. Let us first create a button component −JButton button = new JButton("Button with two borders");Whenever user will keep the mouse cursor on the above button component, the cursor would change to hand cursor −Cursor cursor = button.getCursor(); button.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));The following is ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
989 Views
To delete all rows except a single specific row, try the below syntax −delete from yourTableName where yourColumnName!=yourValue;Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Subject varchar(100) ); Query OK, 0 rows affected (0.65 sec)Insert some ... Read More