Can someone tell me what happened to mine for loop? I spent a lot of time trial and error and research on the Internet, but I still can not find a solution. He goes on to say that the expected identifier cannot find the character. Please help, thanks!
for loop
package imageviewer; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Scanner; import java.util.Vector; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; public class ImageViewer extends JPanel implements ActionListener { JPanel bottomPanel; JLabel imageLabel; JButton previousBtn; JButton nxtBtn; ImageViewer() { imageLabel = new JLabel("Image Display"); imageLabel.setBackground(Color.WHITE); imageLabel.setOpaque(true); add(imageLabel); previousBtn = new JButton("Previous"); previousBtn.addActionListener(this); add(previousBtn); nxtBtn = new JButton("Next"); nxtBtn.addActionListener(this); add(nxtBtn); } String userInput = JOptionPane.showInputDialog("Please input name of first image file"); Scanner myScanner = new Scanner(userInput); String fileDetail = myScanner.next(); String[] arr = fileDetail.split("\\."); String fileName = arr[0].replaceAll("[0-9.]", ""); String fileNumber = arr[0].replaceAll("[^0-9]", ""); String fileFormat = arr[1]; int num = Integer.parseInt(fileNumber); String totalImage = JOptionPane.showInputDialog("Please enter the number of images in total"); Scanner secondScanner = new Scanner(totalImage); int numberInput = secondScanner.nextInt(); ImageIcon imageGraphic = new ImageIcon(fileName + fileNumber + "." + fileFormat); Vector <String> imageDetail = new Vector <String>(); int total = (num + numberInput); for(int i = num; i < total; i++) { } public void actionPerformed(ActionEvent e) { } }
, , , , , .., for . : , , , .
, , " ", , JOptionPane, , , . - . .
, , , , . , , , . , , , , , .
. , .. .
for, , . , .
Source: https://habr.com/ru/post/1548693/More articles:iOS: plist overlay - iosHow to test Spring-cache? - javaFields static class in google analytics v3 - androidParse.com CloudCode find Parse.User objectId with username parameter - javascriptPowerShell Rename-Computer issue - names with underscores - scriptingUsing LESS with MVC5 in Visual Studio 2013 with Web Essentials - model-view-controllerRails Resque workers fail with mysql "Too many connections" - ruby | fooobar.comJasperReports with Maven and Eclipse example - javaRestart completed task - c #Android SDK Manager does not work: download is interrupted: "Tag mismatch" - androidAll Articles