George John has Published 1167 Articles

How to create a left-right split pane in Java?

George John

George John

Updated on 30-Jul-2019 22:30:26

205 Views

To create a left-right split pane, let us create two components and split them −JComponent one = new JLabel("Left Split"); one.setBorder(BorderFactory.createLineBorder(Color.MAGENTA)); JComponent two = new JLabel("Right Split"); two.setBorder(BorderFactory.createLineBorder(Color.ORANGE));Now, we will split them. The two components will be split one to the left of the other using HORIZONTAL_PANE constant −JSplitPane splitPane ... Read More

Hidden features of C++

George John

George John

Updated on 30-Jul-2019 22:30:26

391 Views

Here we will see some good features and tricks of C++ programming language that can help us in different area. Like if we want to participate in some competitive programming events, then these tricks will help us to reduce the time for writing codes. Let us see some of these ... Read More

How to get the date between TODAY and TODAY-7”?

George John

George John

Updated on 30-Jul-2019 22:30:26

6K+ Views

To get the date between dates, you need to use. Here, we are getting the dates between today and today-7 days −select *from yourTableName where DATE(yourColumnName) > (NOW() - INTERVAL 7 DAY);Note : Let’s say the current date is '2019-06-02’ Let us first create a table.mysql> create table DemoTable   ... Read More

IPC using Message Queues

George John

George John

Updated on 30-Jul-2019 22:30:26

3K+ Views

Why do we need message queues when we already have the shared memory? It would be for multiple reasons, let us try to break this into multiple points for simplification −As understood, once the message is received by a process it would be no longer available for any other process. ... Read More

How to create a top-bottom split pane in Java?

George John

George John

Updated on 30-Jul-2019 22:30:26

269 Views

To create a top-bottom split pane, let us create two components and split them −JComponent one = new JLabel("Top Split"); one.setBorder(BorderFactory.createLineBorder(Color.MAGENTA)); JComponent two = new JLabel("Bottom Split"); two.setBorder(BorderFactory.createLineBorder(Color.ORANGE));Now, we will split them. The two components will be split one on top of the other using VERTICAL_PANE constant −JSplitPane splitPane = ... Read More

Is name a reserved word in MySQL?

George John

George John

Updated on 30-Jul-2019 22:30:26

245 Views

No, name is not a reserved word in MySQL, you can use without backtick symbol. If you are working on a reserved word then use backtick symbol. Let us first create a table −mysql> create table name    (    name varchar(10)    ); Query OK, 0 rows affected (0.78 ... Read More

How to create timer using C++11?

George John

George John

Updated on 30-Jul-2019 22:30:26

1K+ Views

Here we will see how to make timer using C++. Here we are creating one class called later. This class has following properties.int (milliseconds to wait until to run code)bool (If this is true, it returns instantly, and run the code after specified time on another thread)The variable arguments (exactly ... Read More

I/O Redirection in C++

George John

George John

Updated on 30-Jul-2019 22:30:26

530 Views

In C, we can use the freopen() function for redirection purposes. Using this function, we can redirect existing FILE pointer to another stream. The syntax of the freopen is like below:FILE *freopen(const char* filename, const char* mode, FILE *stream)In C++ also, we can do the redirection. In C++, the streams ... Read More

HTML DOM Anchor pathname Property

George John

George John

Updated on 30-Jul-2019 22:30:26

62 Views

The HTML DOM Anchor pathname property is used to set or return the path name of the href attribute.Following is the syntax to set the pathname property −anchorObj.pathname = pathAbove, path is the pathname of the URL.Following is the syntax to return the pathname property −anchorObj.pathnameLet us now see an ... Read More

Java Program to set different height for multiple rows in JTable

George John

George John

Updated on 30-Jul-2019 22:30:26

127 Views

To set different height for multiple rows, use the setRowHeight() method for separate rows for which you want to increase the row height. Let us first see an example to create a table with same height for all the rows −Examplepackage my; import java.awt.Color; import java.awt.Font; import javax.swing.JFrame; import javax.swing.JScrollPane; ... Read More

Advertisements