You can create your own .xml layout and assign it using builder.setView() . In the layout, create two ListView that fill with the halves of the original array of names through adapters.
(Directly using builder.setItems() will not succeed, as this method creates its own ListView , and adds it to the layout itself).
You get this result:

// activity_alert_dialog_custom_view.xml :
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal"> <LinearLayout android:layout_weight="1" android:layout_width="0dp" android:layout_height="match_parent" android:orientation="vertical"> <ListView android:id="@+id/listView1" android:layout_width="match_parent" android:layout_height="match_parent"> </ListView> </LinearLayout> <LinearLayout android:layout_weight="1" android:layout_width="0dp" android:layout_height="match_parent" android:orientation="vertical"> <ListView android:id="@+id/listView2" android:layout_width="match_parent" android:layout_height="match_parent" /> </LinearLayout> </LinearLayout>
// MyDialogFragment.java :
import android.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.Toast; import java.util.ArrayList; import java.util.List; public class MyDialogFragment extends DialogFragment { private String[] catNames = {"ΠΠ°ΡΡΠΊΠ°1", "Π ΡΠΆΠΈΠΊ2", "ΠΡΡΠ·ΠΈΠΊ3", "Π ΡΠΆΠΈΠΊ4", "ΠΡΡΠ·ΠΈΠΊ5", "Π ΡΠΆΠΈΠΊ6", "ΠΡΡΠ·ΠΈΠΊ7", "Π ΡΠΆΠΈΠΊ8", "ΠΡΡΠ·ΠΈΠΊ9", "Π ΡΠΆΠΈΠΊ10", "ΠΡΡΠ·ΠΈΠΊ112"}; private AlertDialog alertDialog; @Override public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle("ΠΡΠ±Π΅ΡΠΈΡΠ΅ ΠΊΠΎΡΠ°"); builder.setCancelable(true); final View customView = getActivity().getLayoutInflater().inflate( R.layout.activity_alert_dialog_custom_view, null); builder.setView(customView); List<String> items1 = new ArrayList<>(); List<String> items2 = new ArrayList<>(); if (catNames != null) { for (int i = 0; i < catNames.length; i += 2) { if (i + 2 <= catNames.length) { // ΠΠ²Π° ΠΊΠΎΡΠ° Π² ΡΡΡΠΎΠΊΠ΅: items1.add(catNames[i]); items2.add(catNames[i + 1]); } else { // ΠΡΡΠ°Π»ΡΡ ΠΎΠ΄ΠΈΠ½ ΠΊΠΎΡ: items1.add(catNames[i]); } } } ListView listView1 = customView.findViewById(R.id.listView1); ListView listView2 = customView.findViewById(R.id.listView2); ArrayAdapter<String> adapter1 = new ArrayAdapter<>(getActivity(), android.R.layout.simple_list_item_1, items1); ArrayAdapter<String> adapter2 = new ArrayAdapter<>(getActivity(), android.R.layout.simple_list_item_1, // Π·Π΄Π΅ΡΡ ΡΠΎΠΆΠ΅ ..._1 ! items2); listView1.setAdapter(adapter1); listView2.setAdapter(adapter2); AdapterView.OnItemClickListener onItemClickListener = new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { alertDialog.cancel(); Toast.makeText(getActivity(), "ΠΡΠ±ΡΠ°Π½Π½ΡΠΉ ΠΊΠΎΡ: " + ((ArrayAdapter) ((ListView) parent).getAdapter()).getItem(position), Toast.LENGTH_SHORT).show(); } }; listView1.setOnItemClickListener(onItemClickListener); listView2.setOnItemClickListener(onItemClickListener); alertDialog = builder.create(); return alertDialog; } }
// MainActivity.java :
import android.app.AlertDialog; import android.app.FragmentManager; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.TextView; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void button_onClick(View view) { MyDialogFragment myDialogFragment = new MyDialogFragment(); FragmentManager manager = getFragmentManager(); myDialogFragment.show(manager, "dialog"); } }
// activity_main.xml :
<?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="8dp" android:layout_marginTop="8dp" android:onClick="button_onClick" android:text="Button" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> </android.support.constraint.ConstraintLayout>
Links: While installing Android Studio and Intel HAXM, managed to read an introduction to programming on Android ( lesson 1 , lesson 2 ) and about AlertList ( lesson 30 ), and google Android Custom Layout AlertDialog Example , Android Layout: width half of parent , Dynamically can I set onClickListener on ArrayAdapter? .
And this is not JavaFX at all ...