الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

Recompile With -xlint:unchecked For Details. ماهذا الخطاء

بدأه mohammeding في 17 سبتمبر 2008 · 6 رد · 724 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم

أعمل على تطوير برنامج ب جي كريتور فطلعلي هذا المساج

Recompile with -Xlint:unchecked for details.

أرجو مساعدة

#2
mohammeding كتب:
السلام عليكم

أعمل على تطوير برنامج ب جي كريتور فطلعلي هذا المساج

Recompile with -Xlint:unchecked for details.

أرجو مساعدة

أخي هدا ليس مشكل ففي استعمال list ou arry يكتب الجي كرياتور في الكنسول دلك

image-27.gif

concepteur realisateur java j2ee

php5 and asp

#3

ممكن أفهم أكثر

#4

En fait, votre code est en cours d'élaboration. Le compilateur est juste vous avertissant que vous tentez d'utiliser ou de passer outre au moins une méthode obsolète. Habituellement, une méthode est déconseillée car elle est dangereuse ou sa signification n'est pas claire, mais il est laissé afin que les programmes antérieurs n'ont utiliser la méthode de travail encore. Vous pouvez essayer de modifier les paramètres lorsque vous compilez il montre les détails de la mise en garde. Si vous ne savez pas comment faire, vous pouvez publier votre code pour que nous puissions trouver la méthode obsolète.

image-27.gif

concepteur realisateur java j2ee

php5 and asp

#5

هاهي الشفرة يأخي

هي كلاس تقوم بعملية بحث في jtextArea

class reche   extends JFrame  implements ActionListener
  {
   //JFrame framee;
 JPanel pannoRech;
  JPanel inter2;
  JLabel labRech;
  JTextField jtf;
  JPanel boutons;
  JButton ok;
  JButton annuler;
  JButton visu;
  JList resultat;
  JScrollPane scrollRech;
  Vector res;
  File fichier;
  BufferedReader bfr;
  int numero = 0;

	  public reche(File f) 
	  {
	  fichier = f;
		setTitle("Rechercher...");
		setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
		setResizable(false);
		setLocation(300, 150);

		pannoRech = new JPanel(new BorderLayout(5, 5));
		inter2 = new JPanel(new FlowLayout());

		labRech = new JLabel("Rechercher : ");

		jtf = new JTextField(20);
		jtf.addActionListener ( this );

		boutons = new JPanel(new GridLayout(3, 1, 10, 5));
		ok = new JButton("Ok");
		ok.addActionListener ( this );
		annuler = new JButton("Annuler");
		annuler.addActionListener ( this );
		visu = new JButton("Visualiser");
		visu.setEnabled(false);

		res = new Vector();

		resultat = new JList(res);

		scrollRech = new JScrollPane(resultat);

		inter2.add(labRech);
		inter2.add(jtf);

		boutons.add(ok);
		boutons.add(annuler);
		boutons.add(visu);

		pannoRech.add(inter2, BorderLayout.CENTER);
		pannoRech.add(boutons, BorderLayout.EAST);

		getContentPane().setLayout(new BorderLayout(5, 5));

		getContentPane().add(pannoRech, BorderLayout.NORTH);
		getContentPane().add(scrollRech, BorderLayout.CENTER);

		pack();
	  }

	   public void actionPerformed ( ActionEvent e ) 
	  { 
			Object src = e.getSource();
			if (src==annuler){
						   setVisible(false);
							 }

			 if (src==ok){

							 res.removeAllElements();
							  numero = 0;
							  resultat.updateUI();
							try
							   {
								 if(!jtf.getText().equals("")) 
								 rechercherUneChaine(jtf.getText(), fichier);

							 }
							  catch(FileNotFoundException fnfe)
							   {
								 System.err.print("filenotfound prob !!");
							   }
							  catch(IOException ioe)
							   {
								 System.err.print("io prob !!");
							   }


						}

			 if (src==jtf){
			  res.removeAllElements();
		numero = 0;
		resultat.updateUI();
		try
		{
		  if(!jtf.getText().equals("")) rechercherUneChaine(jtf.getText(), fichier);
		}
		catch(FileNotFoundException fnfe)
		{
		  System.err.print("filenotfound prob !!");
		}
		catch(IOException ioe)
		{
		  System.err.print("io prob !!");
		}
			 }	   
	  }

  public void rechercherUneChaine(String s, File f) throws IOException, FileNotFoundException
  {

	 setTitle("Recherche de \" "+s+" \"");
	bfr = new BufferedReader(new FileReader(f));
	String ligne = bfr.readLine();
	int index;
   try
	{
	  while( ligne != "" )
	  {
		index = ligne.indexOf(s);
		numero += 1;
		if(index != -1)
		{
		  res.addElement(numero+","+index+" : "+ligne);
		}
		ligne = bfr.readLine();
	  }
	}
	catch(NullPointerException npe) {}
	jtf.selectAll();
	jtf.setText("");
	if (!res.isEmpty()) visu.setEnabled(true);
	else visu.setEnabled(false);
	resultat.updateUI();
	boutons.updateUI();
  }
  }
#6

voila mon frere

bnisba import la bibio dyalk

import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
import java.util.*;
import java.io.*;



@SuppressWarnings("serial")
class reche  extends JFrame  implements ActionListener
  {
   //JFrame framee;
JPanel pannoRech;
  JPanel inter2;
  JLabel labRech;
  JTextField jtf;
  JPanel boutons;
  JButton ok;
  JButton annuler;
  JButton visu;
  JList resultat;
  JScrollPane scrollRech;
  @SuppressWarnings("unchecked")
  Vector res = new Vector();
  File fichier;
  BufferedReader bfr;
  int numero = 0;

	  public reche(File f)
	  {
	  fichier = f;
		setTitle("Rechercher...");
		setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
		setResizable(false);
		setLocation(300, 150);

		pannoRech = new JPanel(new BorderLayout(5, 5));
		inter2 = new JPanel(new FlowLayout());

		labRech = new JLabel("Rechercher : ");

		jtf = new JTextField(20);
		jtf.addActionListener ( this );

		boutons = new JPanel(new GridLayout(3, 1, 10, 5));
		ok = new JButton("Ok");
		ok.addActionListener ( this );
		annuler = new JButton("Annuler");
		annuler.addActionListener ( this );
		visu = new JButton("Visualiser");
		visu.setEnabled(false);

		resultat = new JList(res);

		scrollRech = new JScrollPane(resultat);

		inter2.add(labRech);
		inter2.add(jtf);

		boutons.add(ok);
		boutons.add(annuler);
		boutons.add(visu);

		pannoRech.add(inter2, BorderLayout.CENTER);
		pannoRech.add(boutons, BorderLayout.EAST);

		getContentPane().setLayout(new BorderLayout(5, 5));

		getContentPane().add(pannoRech, BorderLayout.NORTH);
		getContentPane().add(scrollRech, BorderLayout.CENTER);

		pack();
	  }

	   public void actionPerformed ( ActionEvent e )
	  {
			Object src = e.getSource();
			if (src==annuler){
						   setVisible(false);
							 }

			 if (src==ok){

							 res.removeAllElements();
							  numero = 0;
							  resultat.updateUI();
							try
							   {
								 if(!jtf.getText().equals(""))
								 rechercherUneChaine(jtf.getText(), fichier);

							 }
							  catch(FileNotFoundException fnfe)
							   {
								 System.err.print("filenotfound prob !!");
							   }
							  catch(IOException ioe)
							   {
								 System.err.print("io prob !!");
							   }


						}

			 if (src==jtf){
			  res.removeAllElements();
		numero = 0;
		resultat.updateUI();
		try
		{
		  if(!jtf.getText().equals("")) rechercherUneChaine(jtf.getText(), fichier);
		}
		catch(FileNotFoundException fnfe)
		{
		  System.err.print("filenotfound prob !!");
		}
		catch(IOException ioe)
		{
		  System.err.print("io prob !!");
		}
			 }	  
	  }

  @SuppressWarnings("unchecked")
public void rechercherUneChaine(String s, File f) throws IOException, FileNotFoundException
  {

	 setTitle("Recherche de \" "+s+" \"");
	bfr = new BufferedReader(new FileReader(f));
	String ligne = bfr.readLine();
	int index;
   try
	{
	  while( ligne != "" )
	  {
		index = ligne.indexOf(s);
		numero += 1;
		if(index != -1)
		{
		  res.addElement(numero+","+index+" : "+ligne);
		}
		ligne = bfr.readLine();
	  }
	}
	catch(NullPointerException npe) {}
	jtf.selectAll();
	jtf.setText("");
	if (!res.isEmpty()) visu.setEnabled(true);
	else visu.setEnabled(false);
	resultat.updateUI();
	boutons.updateUI();
  }
  }
image-27.gif

concepteur realisateur java j2ee

php5 and asp

#7

Merci beaucoup

شكرا لك

بارك الله فيك ربي يجعلها في ميزان حسناتك

مواضيع مشابهة