Monday, 29 July 2013
By Noura Yehia JavaScript libraries have made huge leaps and bounds in helping developers write code and develop products more quickly. jQuery is one of the most popular JavaScript frameworks, with powerful tools that improve the user’s interaction with Web applications. jQuery has an additional advantage in that it allows developers to select elements on a page using CSS-like syntax. To help you take it up a notch, we share below some methods...
/* * login_form.java * * Created on July 16, 2013, 10:57 AM */package loginform;/** * * @author LTIET_CSE_DEPT */public class login_form extends javax.swing.JFrame { /** Creates new form login_form */ public login_form() { initComponents(); jOptionPane1.setVisible(false); } /** This method is called from within the...
Saturday, 27 July 2013
package ajt;import java.awt.*;import java.awt.event.*;import javax.swing.*;class StudentReg extends JPanel implements ActionListener { JButton b1; JTextField t1,t2,t3; JLabel l1,l2,l3,l4; JCheckBox c1,c2,c3; JRadioButton r1,r2; ButtonGroup bg1; JComboBox cb; String str="Game : "; JCheckBox c[] = new JCheckBox[3]; public StudentReg() ...
package ajt;/** * * @author SAGAR */public class StudentRegForm extends javax.swing.JFrame { /** Creates new form StudentRegForm */ public StudentRegForm() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated...
import javax.swing.JFrame; import javax.swing.JCheckBox; import javax.swing.JButton; import javax.swing.JOptionPane; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class GetSelectedJCheckBox implements ActionListener { //Create String that will be use to hold selected JCheckBox text String selectedCheckBox=""; //Create check box using JCheckBox JCheckBox checkBox1=new JCheckBox("Duck"); JCheckBox checkBox2=new JCheckBox("Chicken"); JCheckBox checkBox3=new JCheckBox("Cow"); JCheckBox checkBox4=new JCheckBox("Sheep"); //Create button using JButton with text ( Get selected JCheckBox ) JButton button=new JButton("Get selected JCheckBox"); //method actionPerformed that we override because we implement ActionListener public void actionPerformed(ActionEvent event) { //Action for button if(event.getSource()==button) { //Check first JCheckBox is selected or not if(checkBox1.isSelected()) { selectedCheckBox=selectedCheckBox+checkBox1.getText()+"\n"; } //Check second JCheckBox is selected or not if(checkBox2.isSelected()) { selectedCheckBox=selectedCheckBox+checkBox2.getText()+"\n"; } //Check third JCheckBox is selected or not if(checkBox3.isSelected()) { selectedCheckBox=selectedCheckBox+checkBox3.getText()+"\n"; } //Check fourth JCheckBox is selected or not if(checkBox4.isSelected()) { selectedCheckBox=selectedCheckBox+checkBox4.getText()+"\n"; } //Show message that tell you, what check box that you selected JOptionPane.showMessageDialog(null,"Selected check box is : \n"+selectedCheckBox); //Make selectedCheckBox string like initial with empty string selectedCheckBox=new String(""); } } //Constructor public GetSelectedJCheckBox() { //Create a window using JFrame with title ( Get selected JCheckBox ) JFrame frame=new JFrame("Get selected JCheckBox"); //Create layout that will be use by JFrame GridLayout gl=new GridLayout(5,1); //Add ActionListener to button button.addActionListener(this); //Set JFrame layout frame.setLayout(gl); //Add all created check box into JFrame frame.add(checkBox1); frame.add(checkBox2); frame.add(checkBox3); frame.add(checkBox4); //Add created button into JFrame frame.add(button); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(350,200); frame.setVisible(true); } //Main method public static void main(String[]args) { GetSelectedJCheckBox gsjcb=new GetSelectedJCheckBox(); } } ...
Subscribe to:
Posts (Atom)
Blogger templates
Popular Posts
-
500 topics for projects. IT engineering Final year projects and mini projects,Computer Science & Engineering final year project idea Hi ...
-
If you want to block tough proxies like hidemyass.com, my previously posted .htaccess methods won’t work. Those methods will block quite...
-
There are many ways to encode and decode PHP code. From the perspective of site security, there are three PHP functions — str_rot13() , b...
-
Create your own API with Restler By Richard Askew on July 17, 2013 | 1 comment ...
-
60+ Awesome New WordPress Themes Blog Post In: http://www.webdesignerdepot.com It seems like every time you go looking for a new WordPress ...
-
Ajax-Powered Error Logs Update: Check out the new and improved Ajax Error Log Version 2.0! As an obsessive website administrator, I like to...
-
PHP Tip: Encode & Decode Data URLs Converting small images to data-URLs is a great way to eliminate HTTP requests and decrease loading...
-
4 Ways To Make Your Blog Pay Real Money May 13, 2012 By James Bruce http://www.makeuseof.com/ Writing a popula...
-
Computer Engineering: HTTP Headers for ZIP File Downloads : HTTP Headers for ZIP File Downloads You know when you you’re working on a proj...
-
By Noura Yehia JavaScript libraries have made huge leaps and bounds in helping developers write code and develop products more quickly. jQu...