- 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
Arjun Thakur has Published 1109 Articles
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
Arjun Thakur
541 Views
Yes, we can hide the header from a table. Use the setTableHeader() method and set it to null -table.setTableHeader(null);Above, the table is our JTable -JTable table = new JTable(marks, col)The following is an example to hide the table header -Examplepackage my; import java.awt.Color; import java.awt.Font; import javax.swing.JFrame; import javax.swing.JScrollPane; import ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
Arjun Thakur
6K+ Views
Python functions can return multiple values. These values can be stored in variables directly. A function is not restricted to return a variable, it can return zero, one, two or more values.This is the default property of python to return multiple values/variables which is not available in many other programming ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
Arjun Thakur
487 Views
To create a Titleless and Borderless JFrame, use the setUndecorated() method and set it to TRUE −JFrame frame = new JFrame("Register!"); frame.setUndecorated(true);The following is an example to create a titleless and borderless JFrame −Examplepackage my; import java.awt.GridLayout; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPasswordField; import javax.swing.JTextField; import javax.swing.SwingConstants; public class SwingDemo ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
Arjun Thakur
160 Views
To create and set empty border to a component, use the BorderFactory class createEmptyBorder() method −EmptyBorder emptyBorder = (EmptyBorder) BorderFactory.createEmptyBorder();To set the above border to a component, use the setBorder() method −JButton button = new JButton("Empty Border"); button.setBorder(emptyBorder);The following is an example to create and set and empty border from ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
Arjun Thakur
96 Views
At first, set the setShowGrid() to FALSE to disable all the grid lines. To display only horizontal grid lines in a table, set the method setShowHorizontalLines() to TRUE. Let us first create a table with rows and columns −String[][] rec = { { "1", "Steve", "AUS" }, { "2", ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
Arjun Thakur
451 Views
To disable auto resizing for a table in Java, set the setAutoResizeMode() to AUTO_RESIZE_OFF −JTable table = new JTable(tableModel); table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);The following is an example to disable auto resizing for a JTable in Java −package my; import java.awt.Dimension; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JRootPane; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.table.DefaultTableModel; public ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
Arjun Thakur
1K+ Views
To retrieve the value of a cell, use the getValueAt() method. As parameters, set the row and column index value for which you want the cell value −int rIndex = 5; // row index int cIndex = 1; // column index Object ob = table.getValueAt(rIndex, cIndex);Display the cell value in ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
Arjun Thakur
299 Views
To set the the color of a single tab’s text, use the setForegroundAt() method. This gives an option to mention the index and the color. The index here is the index of the specific tab you want to color the text.Let us first create a JTabbedPane −JTabbedPane tabbedPane = new ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
Arjun Thakur
113 Views
No, you need to use open and close parenthesis like this ( ) while creating a table. Use the below syntax −CREATE TABLE IF NOT EXISTS yourTableName ( yourColumnName1 dataType1, . . . . . N );Let us first create a table −mysql> ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
Arjun Thakur
71 Views
To set the text of the label component to be right-justified and top-aligned, you need to set the alignment. Set the label to be on the right and top aligned −JLabel label = new JLabel("Fav Sports", JLabel.RIGHT); label.setVerticalAlignment(JLabel.TOP);Here, we have set the size of the label as well as the ... Read More