How to set common Menu for all JFrames and Browse Pages?

Step-1: Create 4 JFrames and those are JFrameMain, JFrameOne, JFrameTwo, JFrameThree Step-2: We shall create a ‘CommonMenu’ class and there we shall make a method ‘displayMenu’ package com.coderbd.swing; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; /** * * @author Rajaul...

Android Hide and Show buttons from a condition

Your button is in the XML layout, so you can hide it or show it by just changing its visibility NB: You only need do these operations once: Get a reference to your button, with findViewById() Set the OnClickListener of the button   <Button android:id=”@+id/admin_new_questions”...

Java 2D and 3D Array

In Java, it is also possible to create an array of arrays known as multidimensional array. For example, we can declare and initialize a 2D array like bellow: int[][] twoDArray = new int[3][4]; In above example, there is 3 Rows and 2 columns. Look at...