java dilində yazılmış proqram

java dilini bilənlər məndə java dilində yazılmış proqramda sintaksis sərfi var xaiş mənə köməklik göstərin kim bilirsə kodu yolluyum sintaksis sərfini düzəltsin, tələbəyəm javanı təzə keçirəm sərfi tapammıram


Kateqoriya: Sual . , . Qısa keçid.

Verilmiş cavablar və yazılan şərhlər (3 cavab var)

(02:54, 25/11/2014 ) #49664

burda paylaşın, bəlkə kömək eləyə bildik.

p.s. yazı dilinizdə də xeyli sintaksis səhvləri var 🙂

Cavablamaq üçün sağ sütundan hesaba daxil olmaq lazımdır

    (17:46, 30/11/2014 ) #49984
    /*
     *@author William_Wilson
     *@version 1.0
     *Created May 12, 2007
     */
    
    /*
     *Import List
     */
    import java.io.File;
    
    import java.awt.Container;
    import java.awt.event.ActionEvent;
    import java.awt.image.BufferedImage;
    import java.awt.event.ActionListener;
    
    import javax.swing.JPanel;
    import javax.swing.JLabel;
    import javax.swing.JButton;
    import javax.swing.ImageIcon;
    import javax.swing.JMenuItem;
    import javax.swing.JTextArea;
    import javax.imageio.ImageIO;
    import javax.swing.JOptionPane;
    import javax.swing.JFileChooser;
    
    /*
     *Steganography_Controller Class
     */
    public class Steganography_Controller
    {
    	//Program Variables
    	private Steganography_View	view;
    	private Steganography		model;
    	
    	//Panel Displays
    	private JPanel		decode_panel;
    	private JPanel		encode_panel;
    	//Panel Variables
    	private JTextArea 	input;
    	private JButton		encodeButton,decodeButton;
    	private JLabel		image_input;
    	//Menu Variables
    	private JMenuItem 	encode;
    	private JMenuItem 	decode;
    	private JMenuItem 	exit;
    	
    	//action event classes
    	private Encode			enc;
    	private Decode			dec;
    	private EncodeButton	encButton;
    	private DecodeButton	decButton;
    	
    	//decode variable
    	private String			stat_path = "";
    	private String			stat_name = "";
    	
    	/*
    	 *Constructor to initialize view, model and environment variables
    	 *@param aView  A GUI class, to be saved as view
    	 *@param aModel A model class, to be saved as model
    	 */
    	public Steganography_Controller(Steganography_View aView, Steganography aModel)
    	{
    		//program variables
    		view  = aView;
    		model = aModel;
    		
    		//assign View Variables
    		//2 views
    		encode_panel	= view.getTextPanel();
    		decode_panel	= view.getImagePanel();
    		//2 data options
    		input			= view.getText();
    		image_input		= view.getImageInput();
    		//2 buttons
    		encodeButton	= view.getEButton();
    		decodeButton	= view.getDButton();
    		//menu
    		encode			= view.getEncode();
    		decode			= view.getDecode();
    		exit			= view.getExit();
    		
    		//assign action events
    		enc = new Encode();
    		encode.addActionListener(enc);
    		dec = new Decode();
    		decode.addActionListener(dec);
    		exit.addActionListener(new Exit());
    		encButton = new EncodeButton();
    		encodeButton.addActionListener(encButton);
    		decButton = new DecodeButton();
    		decodeButton.addActionListener(decButton);
    		
    		//encode view as default
    		encode_view();
    	}
    	
    	/*
    	 *Updates the single panel to display the Encode View.
    	 */
    	private void encode_view()
    	{
    		update();
    		view.setContentPane(encode_panel);
    		view.setVisible(true);
    	}
    	
    	/*
    	 *Updates the single panel to display the Decode View.
    	 */
    	private void decode_view()
    	{
    		update();
    		view.setContentPane(decode_panel);
    		view.setVisible(true);
    	}
    	
    	/*
    	 *Encode Class - handles the Encode menu item
    	 */
    	private class Encode implements ActionListener
    	{
    		/*
    		 *handles the click event
    		 *@param e The ActionEvent Object
    		 */
    		public void actionPerformed(ActionEvent e)
    		{
    			encode_view(); //show the encode view
    		}
    	}
    	
    	/*
    	 *Decode Class - handles the Decode menu item
    	 */
    	private class Decode implements ActionListener
    	{
    		/*
    		 *handles the click event
    		 *@param e The ActionEvent Object
    		 */
    		public void actionPerformed(ActionEvent e)
    		{
    			decode_view(); //show the decode view
    			
    			//start path of displayed File Chooser
    			JFileChooser chooser = new JFileChooser("./");
    			chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
    			chooser.setFileFilter(new Image_Filter());
    			int returnVal = chooser.showOpenDialog(view);
    			if (returnVal == JFileChooser.APPROVE_OPTION){
    				File directory = chooser.getSelectedFile();
    				try{
    					String image = directory.getPath();
    					stat_name = directory.getName();
    					stat_path = directory.getPath();
    					stat_path = stat_path.substring(0,stat_path.length()-stat_name.length()-1);
    					stat_name = stat_name.substring(0, stat_name.length()-4);
    					image_input.setIcon(new ImageIcon(ImageIO.read(new File(image))));
    				}
    				catch(Exception except) {
    				//msg if opening fails
    				JOptionPane.showMessageDialog(view, "The File cannot be opened!", 
    					"Error!", JOptionPane.INFORMATION_MESSAGE);
    				}
    			}
    		}
    	}
    	
    	/*
    	 *Exit Class - handles the Exit menu item
    	 */
    	private class Exit implements ActionListener
    	{
    		/*
    		 *handles the click event
    		 *@param e The ActionEvent Object
    		 */
    		public void actionPerformed(ActionEvent e)
    		{
    			System.exit(0); //exit the program
    		}
    	}
    	
    	/*
    	 *Encode Button Class - handles the Encode Button item
    	 */
    	private class EncodeButton implements ActionListener
    	{
    		/*
    		 *handles the click event
    		 *@param e The ActionEvent Object
    		 */
    		public void actionPerformed(ActionEvent e)
    		{
    			//start path of displayed File Chooser
    			JFileChooser chooser = new JFileChooser("./");
    			chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
    			chooser.setFileFilter(new Image_Filter());
    			int returnVal = chooser.showOpenDialog(view);
    			if (returnVal == JFileChooser.APPROVE_OPTION){
    				File directory = chooser.getSelectedFile();
    				try{
    					String text = input.getText();
    					String ext  = Image_Filter.getExtension(directory);
    					String name = directory.getName();
    					String path = directory.getPath();
    					path = path.substring(0,path.length()-name.length()-1);
    					name = name.substring(0, name.length()-4);
    					
    					String stegan = JOptionPane.showInputDialog(view,
    									"Enter output file name:", "File name",
    									JOptionPane.PLAIN_MESSAGE);
    					
    					if(model.encode(path,name,ext,stegan,text))
    					{
    						JOptionPane.showMessageDialog(view, "The Image was encoded Successfully!", 
    							"Success!", JOptionPane.INFORMATION_MESSAGE);
    					}
    					else
    					{
    						JOptionPane.showMessageDialog(view, "The Image could not be encoded!", 
    							"Error!", JOptionPane.INFORMATION_MESSAGE);
    					}
    					//display the new image
    					decode_view();
    					image_input.setIcon(new ImageIcon(ImageIO.read(new File(path + "/" + stegan + ".png"))));
    				}
    				catch(Exception except) {
    				//msg if opening fails
    				JOptionPane.showMessageDialog(view, "The File cannot be opened!", 
    					"Error!", JOptionPane.INFORMATION_MESSAGE);
    				}
    			}
    		}
    		
    	}
    	
    	/*
    	 *Decode Button Class - handles the Decode Button item
    	 */
    	private class DecodeButton implements ActionListener
    	{
    		/*
    		 *handles the click event
    		 *@param e The ActionEvent Object
    		 */
    		public void actionPerformed(ActionEvent e)
    		{
    			String message = model.decode(stat_path, stat_name);
    			System.out.println(stat_path + ", " + stat_name);
    			if(message != "")
    			{
    				encode_view();
    				JOptionPane.showMessageDialog(view, "The Image was decoded Successfully!", 
    							"Success!", JOptionPane.INFORMATION_MESSAGE);
    				input.setText(message);
    			}
    			else
    			{
    				JOptionPane.showMessageDialog(view, "The Image could not be decoded!", 
    							"Error!", JOptionPane.INFORMATION_MESSAGE);
    			}
    		}
    	}
    	
    	/*
    	 *Updates the variables to an initial state
    	 */
    	public void update()
    	{
    		input.setText("");			//clear textarea
    		image_input.setIcon(null);	//clear image
    		stat_path = "";				//clear path
    		stat_name = "";				//clear name
    	}
    	
    	/*
    	 *Main Method for testing
    	 */
    	public static void main(String args[])
    	{
    		new Steganography_Controller(
    									new Steganography_View("Steganography"),
    									new Steganography()
    									);
    	}
    }
    
    Cavablamaq üçün sağ sütundan hesaba daxil olmaq lazımdır

(10:27, 25/11/2014 ) #49673

Siz hansı univeristetde oxuyursunuz? Bilmey isdiyirem ki, hansı univeristetde java keçiller.

Cavablamaq üçün sağ sütundan hesaba daxil olmaq lazımdır

Bu suala aid öz sualım var:
Sual verin
Bu suala cavab vermək istəyirəm:
Cavab verin

Cavab verin


Cavab yazmaq üçün lütfən sağ sütundan və ya buradan hesaba daxil olun.

Üzvlər üçün giriş

Qeydiyyat

Elan qutusu

Son cavablar və şərhlər

Cavablar AI cavab verdi - səsli kitab saytında müəllif hüquqları (34 gün əvvəl)

E. Hacı cavab verdi - səsli kitab saytında müəllif hüquqları (34 gün əvvəl)

evonline.az cavab verdi - Mahni axtariram, azerbaycanin klipi idi. (39 gün əvvəl)

Cənab cavab verdi - Abune kodu - qaz (52 gün əvvəl)

nihatt cavab verdi - Aztelekomun Huawei GPON modeminin login və şifrəsi (69 gün əvvəl)

Mesud cavab verdi - C++ aid məsələ (85 gün əvvəl)

Toofiq cavab verdi - Abune kodu - qaz (86 gün əvvəl)

Toofiq cavab verdi - Mahni axtariram, azerbaycanin klipi idi. (86 gün əvvəl)

selef cavab verdi - gömrük bağlamanı saxladı (104 gün əvvəl)

walkingdead4 cavab verdi - Niqodnilik haqqında yardım ederdiz (120 gün əvvəl)

Devequsu cavab verdi - Niqodnilik haqqında yardım ederdiz (121 gün əvvəl)

E. Hacı cavab verdi - Manual QA vs Wordpress (137 gün əvvəl)

SN cavab verdi - .az domaini whois serveri niyə işləmir? (181 gün əvvəl)

byshako cavab verdi - .az domaini whois serveri niyə işləmir? (182 gün əvvəl)

byshako cavab verdi - .az domaini whois serveri niyə işləmir? (182 gün əvvəl)

Software Developer - 616 xal

E. Hacı - 610 xal

Onar Alili - 526 xal

Dilsuz - 448 xal

Cabbarov Sübhan - 434 xal

Maqa - 346 xal

Ruslan Butdayev - 328 xal

Namiq Bəndəli - 297 xal

U.Tarlan - 244 xal

Meherremoff - 234 xal

Sistemə daxil olmuş 23348 sualdan 92%-dən çoxu cavablandırılmışdır.

Proyekt haqqında

E-Haci.net istehsalı. © 2010-2026