Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Adding a value to a jTable (GUI help)

Featured Replies

Hey there, so im making a fighting script and im trying to make a method for creating a list of items to pick up that the user can put in. the problem im running into right now is that i beleive im doing everything right but on the button press it doesnt add anything to the table. This is my current code. 

 

 
this is how the gui looks if a visual is needed.
 
post-146248-0-44221900-1463351087_thumb.png

Edited by roguehippo

 

Hey there, so im making a fighting script and im trying to make a method for creating a list of items to pick up that the user can put in. the problem im running into right now is that i beleive im doing everything right but on the button press it doesnt add anything to the table. This is my current code. 

 

 
this is how the gui looks if a visual is needed.
 

 

String[] columnNames = { "Username", "Rank" };

		JTable table = new JTable(new DefaultTableModel(data.getData(), columnNames){
			@Override
		    public boolean isCellEditable(int row, int column) {
				//Disable editing of all cells 
		       return false;
		    }
			
		});

public Object[][] getData() {
		Object[][] data = new Object[num of entries][num column];
		int i = 0;
		for(String s : inputMap.keySet()){
			data[i][0] = "entry i, column 0";
			data[i][1] = "entry i, column 1";
			i++;
			} else{
			continue;
			}
		}
		return data;
	}

some leaked code. I had a Data class that would write and read to a file and it puts the data into a Object[][] and then the table can load it. The first dimension in the array is the entry count, the second dimension is the column amount. For example if I had 2 entries and each entry had a name, birthdate, and hometown it would be Object[2][3] and then it would populate 3 columns with 2 entries.

Edited by LoudPacks

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.