【解決方法】各コンボボックスが互いにリンクされているのはなぜですか…? 助けてください


コンストラクターには、3つのコンボボックスが含まれており、それぞれが同じソースの3つの異なるファイル変数を追加しています[ i.e. same path]

実行すると、値が正しく表示されます….
また、コンボ ボックスの各 itemStateChange イベントのコードも正しく機能します。
この時点で問題が始まります….
最初のコンボを選択すると、関連するリストボックスに値が表示されますが、他の2つのコンボに関連付けられたリストボックスにも最初のコンボと同じ値が表示されます
他のコンボも同様です。 それぞれのコンボが連動する理由は…?

私が試したこと:

コンストラクターのコード…

for(File f: fo.listFiles())
		{
			if(f.isAbsolute())
			{
				jComboBox2.addItem(f.toString());
				f=null;
			}
		}
		for(File d:fo.listFiles())
		{
			if(d.isAbsolute())
			{
				jComboBox4.addItem(d.toString());	
				d=null;
			}
		}
		for(File q:fo.listFiles())
		{
			if(q.isAbsolute())
			{
				jComboBox6.addItem(q.toString());
				q=null;
			}
		}
<pre>File fd=new File(fr.toString());
					
					String gg="";
					try
					{
						FileReader fread=new FileReader(fd);
						BufferedReader in=new BufferedReader(fread);
						String line=in.readLine();
						char []po=line.toCharArray();
						int ih=0;int pop=0;
						int v=ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
						int h=ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
						DefaultListModel<string> model=new DefaultListModel<>();
						JList b;JList c;JList kj;model.clear();
						for(ih=0;ih<line.length();ih++)
 {
="" joptionpane.showmessagedialog(null,po[ih]);
="" gg="" ;
="" while(po[ih]!="-" )
="" +="po[ih];
" ih++;
="" }
="" 
="" model.addelement(gg);="" joptionpane.showmessagedialog(null,gg);
="" b="new" jlist(model);
="" b.setlayoutorientation(jlist.vertical);
="" b.setvisible(true);
="" b.addmouselistener(new="" mouseadapter(){
="" public="" void="" mouseclicked(mouseevent="" me)
="" if(me.getclickcount()="=1)
" jlist="" jb="(JList)me.getSource();
" int="" index="jb.locationToIndex(me.getPoint());//JOptionPane.showMessageDialog(null,index);
" if(index="">=0)
										{
											Object item=jb.getModel().getElementAt(index);
										
										}
									}
								}

			
							});
							jsp=new JScrollPane(b,v,h);
							jsp.setBounds(50,170, 180, 110);
							jsp.setVisible(true);
							this.add(jsp);
						}
					}
					catch(Exception e)
					{
					System.out.println("111  "+e.getMessage());
					}
likewise other two same coding in the constructor
now in the itemStateChange event

<pre>for(File fr:fp.listFiles())
		{
			try
			{
			FileReader fread=new FileReader(fr);
			BufferedReader bread=new BufferedReader(fread);		
			if(fr.getName().equals(fq.getName()))
			{
				//JOptionPane.showMessageDialog(null,"Same");
				String gg="";
				DefaultListModel<string> model1=new DefaultListModel<>();JScrollPane jsp4;
				try
				{
					
					String line=bread.readLine();
					char []po=line.toCharArray();
					int ih=0;int pop=0;
					int v=ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
					int h=ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
					JList<string> ko;model1.clear();
					for(ih=0;ih

解決策 1

https://www.russianmodels.in/about-me
https://www.russianmodels.in/lakhimpur-escort-service
https://www.russianmodels.in/arairia-escort-service
https://www.russianmodels.in/arwal-escort-service
https://www.russianmodels.in/banka-escort-service
https://www.russianmodels.in/begusarai-escort-service
https://www.russianmodels.in/bhagalpur-escort-service
https://www.russianmodels.in/bhojpur-escort-service
https://www.russianmodels.in/buxar-escort-service
https://www.russianmodels.in/darbhanga-escort-service

コメント

タイトルとURLをコピーしました