explement
explement
JCHJava Community | Help. Code. Learn.
Created by explement on 12/19/2024 in #java-help
How would I hide a specific Character in a ListArray
tryin to implement it, will let u know
39 replies
JCHJava Community | Help. Code. Learn.
Created by explement on 12/19/2024 in #java-help
How would I hide a specific Character in a ListArray
alright
39 replies
JCHJava Community | Help. Code. Learn.
Created by explement on 12/19/2024 in #java-help
How would I hide a specific Character in a ListArray
like if the array list was ["AAA, "BBB', "CCC"] i know i could do like .delete(0) to delete "AAA", but how would i say delete the middle A of it
39 replies
JCHJava Community | Help. Code. Learn.
Created by explement on 12/19/2024 in #java-help
How would I hide a specific Character in a ListArray
i know how to access an object
39 replies
JCHJava Community | Help. Code. Learn.
Created by explement on 12/19/2024 in #java-help
How would I hide a specific Character in a ListArray
because i cant really find anyway of how to do this
39 replies
JCHJava Community | Help. Code. Learn.
Created by explement on 12/19/2024 in #java-help
How would I hide a specific Character in a ListArray
quick question tho, how do i access a specific character of a object in a arraylist
39 replies
JCHJava Community | Help. Code. Learn.
Created by explement on 12/19/2024 in #java-help
How would I hide a specific Character in a ListArray
so like have a variable for the arraylist with the cursor removed and then apply color?
39 replies
JCHJava Community | Help. Code. Learn.
Created by explement on 12/19/2024 in #java-help
How would I hide a specific Character in a ListArray
because it can get in the middle of keywords and then instead of for example 'def' (which is colored red), it would be 'd|ef' which wont have any color at all
39 replies
JCHJava Community | Help. Code. Learn.
Created by explement on 12/19/2024 in #java-help
How would I hide a specific Character in a ListArray
yes
39 replies
JCHJava Community | Help. Code. Learn.
Created by explement on 12/19/2024 in #java-help
How would I hide a specific Character in a ListArray
this is the code to set the line/col:
public static void controlKeys(int index) {
removeCursor(); // Remove the current cursor

switch (index) {
case 1: // Left arrow key
currentColumn = Math.max(0, currentColumn - 1);
break;
case 2: // Right arrow key
currentColumn = Math.min(fileArray.get(currentLine).length(), currentColumn + 1);
break;
case 3: // Up arrow key
if (currentLine > 0) {
currentLine--;
currentColumn = Math.min(currentColumn, fileArray.get(currentLine).length());
}
break;
case 4: // Down arrow key
if (currentLine < fileArray.size() - 1) {
currentLine++;
currentColumn = Math.min(currentColumn, fileArray.get(currentLine).length());
}
break;
default:
System.out.println("Error");
return;
}

updateCursor();
}
public static void controlKeys(int index) {
removeCursor(); // Remove the current cursor

switch (index) {
case 1: // Left arrow key
currentColumn = Math.max(0, currentColumn - 1);
break;
case 2: // Right arrow key
currentColumn = Math.min(fileArray.get(currentLine).length(), currentColumn + 1);
break;
case 3: // Up arrow key
if (currentLine > 0) {
currentLine--;
currentColumn = Math.min(currentColumn, fileArray.get(currentLine).length());
}
break;
case 4: // Down arrow key
if (currentLine < fileArray.size() - 1) {
currentLine++;
currentColumn = Math.min(currentColumn, fileArray.get(currentLine).length());
}
break;
default:
System.out.println("Error");
return;
}

updateCursor();
}
and this is the code that updates the actual arraylist
private static void updateCursor() { // Update cursor
String currentItem = fileArray.get(currentLine);
String modifiedItem = currentItem.substring(0, currentColumn) + "|" + currentItem.substring(currentColumn);
fileArray.set(currentLine, modified);

displayArrayContent();
}
private static void updateCursor() { // Update cursor
String currentItem = fileArray.get(currentLine);
String modifiedItem = currentItem.substring(0, currentColumn) + "|" + currentItem.substring(currentColumn);
fileArray.set(currentLine, modified);

displayArrayContent();
}
39 replies
JCHJava Community | Help. Code. Learn.
Created by explement on 12/19/2024 in #java-help
How would I hide a specific Character in a ListArray
let me know if u need the rest of the code aswell
39 replies